Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. See our Privacy Policy and
Terms.
openapi: 3.2.0
info:
title: TwittrAPI Account API
version: 1.0.0
summary: Public Twitter/X data over REST, priced per API call.
description: 'TwittrAPI is a REST API for public Twitter/X data: users, tweets, search, followers, lists, communities, jobs and trends. Pay per call from a prepaid balance; no X developer account needed.
Authentication: send your key in the X-API-KEY header. Get a key at https://www.twittrapi.com/start (a human signs up; the key can then be given to an agent).
Responses: X''s raw JSON by default (passthrough), or add format=simple for compact, flat JSON with a fixed schema (same price).
Account actions (tag "Account actions", /client/* and /premium/*): POST endpoints that act on your own X account with its session cookie and your proxy in the JSON body (https://www.twittrapi.com/docs/x-session). Same price per call as reads; trial keys cannot call them.
Pricing (machine-readable): https://www.twittrapi.com/pricing.json. All docs in one file: https://www.twittrapi.com/llms-full.txt.
RapidAPI: the same paths on https://twitter-aio.p.rapidapi.com with the x-rapidapi-key and x-rapidapi-host headers.
Not affiliated with X Corp. Twitter and X are trademarks of X Corp. Only publicly available data is accessible.'
contact:
name: TwittrAPI support
email: support@twittrapi.com
url: https://www.twittrapi.com/docs
termsOfService: https://www.twittrapi.com/terms
license:
name: 'Proprietary: use under the terms of service'
url: https://www.twittrapi.com/terms
servers:
- url: https://api.twittrapi.com
description: Direct API
- url: https://twitter-aio.p.rapidapi.com
description: RapidAPI (x-rapidapi-key and x-rapidapi-host headers instead of X-API-KEY)
security:
- ApiKeyAuth: []
tags:
- name: Account
description: Your TwittrAPI key and balance.
paths:
/balance:
get:
operationId: getBalance
summary: Balance of your key
description: 'Current balance of the key. Free; its own limit of 10 requests per second. More fields exist that the dashboard uses. Reference: https://www.twittrapi.com/docs/billing'
tags:
- Account
externalDocs:
url: https://www.twittrapi.com/docs/billing
responses:
'200':
description: Balance
content:
application/json:
schema:
type: object
additionalProperties: true
properties:
user_id:
type: integer
balance:
type: number
description: USD
price_per_call:
type: number
description: USD
is_active:
type: boolean
'401':
$ref: '#/components/responses/Unauthorized'
'404':
description: Unknown key
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
components:
responses:
Unauthorized:
description: Missing or unknown API key. Not charged.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
schemas:
Error:
type: object
properties:
error:
type: string
description: Message. Do not parse it; use the status code.
errorInfo:
description: X's raw reply, on some endpoints
attempts:
type: integer
description: Search retries
errorCode:
type: string
required:
- error
securitySchemes:
ApiKeyAuth:
type: apiKey
in: header
name: X-API-KEY
description: API key from the dashboard (https://app.twittrapi.com/register).
externalDocs:
description: Documentation
url: https://www.twittrapi.com/docs