> ## 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.

# Quickstart

> Make your first twitterapi.io call in about two minutes: get an API key, run one request, read the JSON.

## 1. Get your API key

1. Sign in at [twitterapi.io](https://twitterapi.io/dashboard) with Google.
2. Copy the API key shown on your dashboard.

New accounts get free starter credits, so you can try the API right away. Accounts that have never topped up are limited to one request every 5 seconds; any top-up raises this (see [Rate limits](/rate-limits)).

## 2. Make your first request

Look up a user profile. Replace `YOUR_API_KEY` with your key:

<CodeGroup>
  ```bash cURL theme={null}
  curl 'https://api.twitterapi.io/twitter/user/info?userName=jack' \
    --header 'x-api-key: YOUR_API_KEY'
  ```

  ```python Python theme={null}
  import requests

  resp = requests.get(
      "https://api.twitterapi.io/twitter/user/info",
      params={"userName": "jack"},
      headers={"x-api-key": "YOUR_API_KEY"},
      timeout=30,
  )
  print(resp.json())
  ```

  ```javascript Node.js theme={null}
  const resp = await fetch(
    "https://api.twitterapi.io/twitter/user/info?userName=jack",
    { headers: { "x-api-key": "YOUR_API_KEY" } }
  );
  console.log(await resp.json());
  ```
</CodeGroup>

## 3. Read the response

A successful call returns HTTP `200` with JSON like this (trimmed; numbers will differ):

```json theme={null}
{
  "status": "success",
  "msg": "success",
  "data": {
    "id": "12",
    "userName": "jack",
    "name": "jack",
    "isBlueVerified": true,
    "followers": 12474546,
    "following": 3,
    "statusesCount": 31008,
    "createdAt": "2006-03-21T20:50:14.000000Z",
    "profilePicture": "https://pbs.twimg.com/profile_images/..._normal.jpg"
  }
}
```

<Note>
  Some "not found" results still return HTTP `200`, with `"status": "error"` in the body, for example `{"status": "error", "msg": "user not found", "data": null}`. Always check `status` as well as the HTTP code. See [Errors](/errors).
</Note>

## 4. Try a search

Search returns up to 20 tweets per page, plus a cursor for the next page:

```bash theme={null}
curl 'https://api.twitterapi.io/twitter/tweet/advanced_search?query=from%3Ajack&queryType=Latest' \
  --header 'x-api-key: YOUR_API_KEY'
```

```json theme={null}
{
  "tweets": [ { "id": "...", "text": "...", "author": { "userName": "jack" } } ],
  "has_next_page": true,
  "next_cursor": "DAADDAAB..."
}
```

Pass `next_cursor` back as `cursor` to get the next page. See [Pagination](/pagination).

## Next steps

<CardGroup cols={2}>
  <Card title="Pricing" icon="coins" href="/pricing">What each endpoint costs, in credits.</Card>
  <Card title="Errors" icon="triangle-exclamation" href="/errors">Status codes and how to handle them.</Card>
  <Card title="Rate limits" icon="gauge" href="/rate-limits">Requests per second by account type.</Card>
  <Card title="Advanced search" icon="magnifying-glass" href="/api-reference/endpoint/tweet_advanced_search">The most-used endpoint.</Card>
</CardGroup>

Questions? Email [hello@twitterapi.io](mailto:hello@twitterapi.io).


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