> ## Documentation Index
> Fetch the complete documentation index at: https://docs.twitterapi.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Login Step 1: by email or username

> Login Step 1: by email or username.Recommend to use email.Price: 300 credits ($0.003 per call). Please read the guide: https://twitterapi.io/blog/twitter-login-and-post-api-guide



## OpenAPI

````yaml POST /twitter/login_by_email_or_username
openapi: 3.0.1
info:
  title: TwitterAPI.io API
  description: >-
    Real-time access to public X (Twitter) data: tweets, users, search, lists,
    communities and streams. Pay per item returned.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.twitterapi.io
security:
  - ApiKeyAuth: []
paths:
  /twitter/login_by_email_or_username:
    post:
      description: >-
        Login Step 1: by email or username.Recommend to use email.Price: 300
        credits ($0.003 per call). Please read the guide:
        https://twitterapi.io/blog/twitter-login-and-post-api-guide
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - username_or_email
                - password
                - proxy
              properties:
                username_or_email:
                  type: string
                  description: >-
                    User name or email.If you can't log in with your email, use
                    your username. If you can't log in with your username, use
                    your email
                    instead.ref:https://twitterapi.io/blog/twitter-login-and-post-api-guide
                password:
                  type: string
                  description: The password of the user
                proxy:
                  type: string
                  description: >-
                    The proxy to use.Please use high-quality residential proxies
                    and avoid free proxies.Required.Example:
                    http://username:password@ip:port . You can get proxy from:
                    https://www.webshare.io/?referral_code=4e0q1n00a504
      responses:
        '200':
          description: Login response
          content:
            application/json:
              schema:
                type: object
                properties:
                  hint:
                    type: string
                    description: >-
                      Hint of the login.eg. "Please use second endpoint
                      /login_2fa to continue login."
                  login_data:
                    type: string
                    description: >-
                      Use this data to call /twitter/login_2fa to continue
                      login.
                  status:
                    type: string
                    description: Status of the request.success or error
                  msg:
                    type: string
                    description: Message of the request.error message
        '400':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.