Quickstart
RelayX is a REST API for public X (Twitter) data. Every request uses the same base URL and one header.
- Base URL:
https://api.relayxapi.com - Auth header:
X-API-Key: <your key>
1. Get a key
Section titled “1. Get a key”Create an account in the dashboard and create an API key. New accounts include free trial credits.
2. Make a request
Section titled “2. Make a request”This example fetches a user profile by handle (no @):
curl "https://api.relayxapi.com/twitter/user/info?userName=jack" \ -H "X-API-Key: YOUR_KEY"import requests
r = requests.get( "https://api.relayxapi.com/twitter/user/info", params={"userName": "jack"}, headers={"X-API-Key": "YOUR_KEY"},)print(r.json()["data"]["followers"])const r = await fetch( "https://api.relayxapi.com/twitter/user/info?userName=jack", { headers: { "X-API-Key": "YOUR_KEY" } },);const body = await r.json();console.log(body.data.followers);3. Read the response
Section titled “3. Read the response”Single-object endpoints wrap the result in data:
{ "status": "success", "msg": "", "data": { "type": "user", "userName": "jack", "id": "12", "name": "jack", "followers": 12281329 }}List endpoints return the items under a named key (such as tweets or followers), plus
has_next_page and next_cursor for paging. Each response carries X-Credits-Cost and
X-Credits-Remaining headers.
- Browse every endpoint in the API reference.
- Check your balance with
GET /account/credits(free).