Twitter API — Getting Started — FetchLayer Docs
FetchLayer fetchlayer.dev Sign in

Getting Started

Get your first Twitter/X API call working in under two minutes.

1. Get your API key

Sign up for a FetchLayer account and generate an API key from the dashboard. Free tier included — no credit card required.

2. Make your first request

Call any endpoint with curl. A TypeScript SDK can be added once the public Twitter package is published.

curl

bash
curl -X POST https://api.fetchlayer.dev/twitter/search \
  -H "Authorization: Bearer ss-your-key" \
  -H "Content-Type: application/json" \
  -d '{"query":"openai","product":"Latest","count":5}'

3. Understand the response

Every endpoint returns structured JSON. The response shape varies by endpoint, but request and authentication patterns stay consistent across the Twitter surface.

json
{
  "results": [
    {
      "id": "1942939879222220800",
      "text": "Example search result from X/Twitter",
      "author": "example_user",
      "createdAt": "2026-07-02T11:25:00.000Z",
      "url": "https://x.com/example_user/status/1942939879222220800"
    }
  ]
}

Next steps