Twitter API — Authentication — FetchLayer Docs
Documentation menu
FetchLayer FetchLayer API

Authentication

All endpoints use Bearer token authentication. No Twitter credentials — just one FetchLayer API key.

API Keys

Generate API keys from your dashboard. Each key is a ss- prefixed secret token. You can create multiple keys, scope them by platform, and revoke them independently.

Keep your key secret

Never expose your API key in client-side code, mobile apps, or public repositories. Make requests from a server you control, and rotate a key immediately if it leaks.

Sending requests

Include your API key in the Authorization header as a Bearer token.

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

Error responses

Invalid or missing API keys return a 401 Unauthorized response.

json
{
  "error": "Invalid API key"
}