Twitter / X Profile API
Read public X / Twitter profile fields and available account statistics.
Read public X / Twitter profile fields and available account statistics.
Open product page and API TesterEndpoint and authentication
POST https://api.goanyapi.com/api/v1/twitter/user/profileResults return synchronously, without tasks or polling. Authenticate using Authorization: Bearer YOUR_API_KEY and send a JSON request body. There are no Path or Query parameters.
Input parameters
| Parameter | Location | Type | Required | Default | Constraints and meaning |
|---|---|---|---|---|---|
| Authorization | Header | string | Yes | — | Bearer YOUR_API_KEY |
| Content-Type | Header | string | Yes | application/json | application/json |
| screenName | JSON body | string | Yes | — | Username, @username or full https://x.com/<username> or https://twitter.com/<username> profile URL. URL parsing is local and adds no separate charge. Short links and other resource types are unsupported. maxLength=2048 |
Use the same resource parameter for a raw identifier or supported full resource URL; no prerequisite ID lookup is needed. URL parsing adds no request or separate charge. Short links and other resource types are unsupported.
Username, @username or full https://x.com/<username> or https://twitter.com/<username> profile URL. URL parsing is local and adds no separate charge. Short links and other resource types are unsupported.
Request example
POST /api/v1/twitter/user/profile
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"screenName": "https://x.com/ChineseWSJ"
}Output fields
Success returns HTTP 200. Business results are in data.result. Null, empty strings, empty arrays and missing business fields are preserved; zero is a valid statistic. Empty display fields do not invalidate an otherwise successful request.
| Field | Type | Meaning |
|---|---|---|
| code | string | ok on success; error code otherwise |
| message | string | Status message |
| data.result | object / null | Business data; null is preserved |
| data.creditsUsed | integer | Credits charged using current configuration |
| data.remainingCredits | number | Balance after settlement |
| data.result.screenName | string | Public business field; may be null, empty or absent |
| data.result.description | string | Public business field; may be null, empty or absent |
| data.result.following | integer | Public business field; may be null, empty or absent |
| data.result.avatar | string | Public business field; may be null, empty or absent |
| data.result.verifiedType | string | Public business field; may be null, empty or absent |
| data.result.id | string | Public business field; may be null, empty or absent |
| data.result.mediaTweetCount | integer | Public business field; may be null, empty or absent |
| data.result.banner | string | Public business field; may be null, empty or absent |
| data.result.location | string | Public business field; may be null, empty or absent |
| data.result.verified | boolean | Public business field; may be null, empty or absent |
| data.result.website | string | Public business field; may be null, empty or absent |
| data.result.tweetCount | integer | Public business field; may be null, empty or absent |
| data.result.protected | boolean | Public business field; may be null, empty or absent |
| data.result.name | string | Public business field; may be null, empty or absent |
| data.result.followers | integer | Public business field; may be null, empty or absent |
| data.result.createdAt | string | Public business field; may be null, empty or absent |
This endpoint has no pagination parameters.
Real response example
Saved from a real successful response with public business fields. The example omits live data.creditsUsed and data.remainingCredits, which use current configuration and account balance. No list records are omitted. Media URLs may expire. Displaying the example sends no request or charge.
{
"code": "ok",
"message": "ok",
"data": {
"result": {
"id": "46574977",
"screenName": "ChineseWSJ",
"name": "华尔街日报中文网",
"avatar": "https://pbs.twimg.com/profile_images/1037219311130234880/KXlUBc9N_normal.jpg",
"banner": "https://pbs.twimg.com/profile_banners/46574977/1722989773",
"description": "感谢您关注华尔街日报中文网。我们有上千位专业记者与资深编辑遍布全球,为读者提供24小时最可靠、即时和深入的市场动向,政商时事,科技趋势和前沿思潮。欢迎阅读并分享见解。\n\n尽管全球局势瞬息万变,可靠的信息来源仍能助您洞悉全局,运筹帷幄。前往https://t.co/Ay39I3A0HH成为会员,尽享赢得全球核心决策者信赖的独到见解和深入分析。",
"location": "China",
"website": "https://cn.wsj.com/",
"createdAt": "2009-06-12T03:55:58.000Z",
"followers": 3341431,
"following": 493,
"tweetCount": 99028,
"mediaTweetCount": 6229,
"verified": true,
"verifiedType": "Blue",
"protected": false
}
}
}Billing
With the current configuration, each successful request costs 1 credit.
Every successful request, including empty results, is settled at the current database-configured rate. Failures are free. Sufficient balance is required before querying; insufficient balance during concurrent settlement returns 402 without delivering unsettled results. URL parsing adds no separate charge.
Status codes and errors
| HTTP | Meaning |
|---|---|
| 200 | Success, including empty results |
| 400 | Invalid JSON or parameters |
| 401 | Invalid authentication |
| 402 | Insufficient credits |
| 429 | Rate limit; wait for Retry-After |
| 502 | Data request failed |
| 503 | API or pricing not configured |
{"code":"invalid_params","message":"Invalid parameter"}