TWITTER API
Search Posts
Retrieve search posts from Twitter with a single API request.
GET
/api/data/v1/twitter/search/posts1credit base cost
Request parameters
Up to 1 creditKeyword or phrase to search for in Google-indexed public X/Twitter posts
Pass the cursor returned by the previous response. Supported page cursors are 1 through 11. A null response cursor means there are no more pages.
Live requests use your prepaid balance. Cached responses cost zero where supported.
curl --request GET \
--url 'https://fetchgoblin.com/api/data/v1/twitter/search/posts?query=ai+agents' \
--header 'x-api-key: YOUR_FETCHGOBLIN_API_KEY'Response
Example{
"success": true,
"credits_charged": 1,
"query": "ai agents",
"posts": [
{
"rest_id": "2105732089685348719",
"url": "https://x.com/code_rams/status/2105732089685348719",
"views": {
"count": "780",
"state": "EnabledWithCount"
},
"legacy": {
"created_at": "Thu Oct 01 18:50:27 +0000 2026",
"full_text": "AI agents are checking your pricing page before your buyers do. Your analytics never shows it.\n\nHere's how to catch them and fix it:\n\n(Analysed and learned from my products)\n\n1. open your analytics or server logs and pull the last 30 days\n\n2. filter by user agent: GPTBot, https://t.co/HO75r0e5Am",
"favorite_count": 11,
"retweet_count": 0,
"reply_count": 4,
"quote_count": 0,
"bookmark_count": 7
}
}
],
"cursor": "2"
}Example data from the API specification. Run a request to retrieve current data.
Response shape
This schema describes the documented data shape. Some platform fields may be absent or null. The response also includes your FetchGoblin request ID and current credit balance.
View JSON Schema +
{
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"credits_remaining": {
"type": "integer"
},
"credits_charged": {
"type": "integer"
},
"query": {
"type": "string"
},
"posts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"rest_id": {
"type": "string"
},
"url": {
"type": "string"
},
"views": {
"type": "object",
"properties": {
"count": {
"type": "string"
},
"state": {
"type": "string"
}
}
},
"legacy": {
"type": "object",
"properties": {
"created_at": {
"type": "string"
},
"full_text": {
"type": "string"
},
"favorite_count": {
"type": "integer"
},
"retweet_count": {
"type": "integer"
},
"reply_count": {
"type": "integer"
},
"quote_count": {
"type": "integer"
},
"bookmark_count": {
"type": "integer"
}
}
}
}
}
},
"cursor": {
"type": "string"
}
}
}