- Cost
- 1 credit
- Cached repeats
- 0 creditssend max_age_days, results kept 30 days
- Failed requests
- 0 credits
DuckDuckGo, restricted to x.com, then read like tweet through X's public post widget, so views, retweet and bookmark counts are missing. This is engine-indexed discovery, not X's own search (which needs a login): coverage is incomplete, recent posts can be missing and the order is the engine's. Deleted, protected and unreachable posts are left out. Cursor pages 1 to 11.
You send query.
Part of the X (Twitter) Scraper API: 7 X (Twitter) endpoints on one key.
Request
Send your key in the x-api-key header.
1curl -G "https://api.socialscrape.dev/v1/twitter/search/posts" \2 -H "x-api-key: $SOCIALSCRAPE_API_KEY" \3 --data-urlencode 'query=ai agents'1import os2import requests34params = {5 "query": "ai agents",6}7res = requests.get(8 "https://api.socialscrape.dev/v1/twitter/search/posts",9 headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},10 params=params,11 timeout=60,12)13body = res.json()1415if body["ok"]:16 print(body["data"])17else:18 print(body["error"]["code"], body["error"]["message"])1const url = new URL("https://api.socialscrape.dev/v1/twitter/search/posts");2url.search = new URLSearchParams({3 query: "ai agents",4}).toString();5const res = await fetch(url, {6 headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },7});8const body = await res.json();910if (body.ok) {11 console.log(body.data);12} else {13 console.error(body.error.code, body.error.message);14}1{2 "nodes": [3 {4 "name": "SocialScrape X post search",5 "type": "n8n-nodes-base.httpRequest",6 "typeVersion": 4.2,7 "position": [8 0,9 010 ],11 "parameters": {12 "method": "GET",13 "url": "https://api.socialscrape.dev/v1/twitter/search/posts",14 "sendQuery": true,15 "queryParameters": {16 "parameters": [17 {18 "name": "query",19 "value": "ai agents"20 }21 ]22 },23 "sendHeaders": true,24 "headerParameters": {25 "parameters": [26 {27 "name": "x-api-key",28 "value": "={{ $env.SOCIALSCRAPE_API_KEY }}"29 }30 ]31 }32 }33 }34 ],35 "connections": {}36}Parameters
| Name | Type | Required | Description |
|---|---|---|---|
query | string | yes | Keyword or phrase to look for in public X posts. Also accepted as keyword, q. |
cursor | string | Opaque cursor from the previous page; pass it back unchanged. Also accepted as continuationToken, continuation_token, next_max_id, max_id, max_cursor, min_time, after, page_token, pageToken, paginationToken, next_page_id, page. |
Every request also accepts trim, raw and max_age_days.
Response
Sample from a recorded response, shortened. Values are examples, not your data.
1{2 "ok": true,3 "credits_charged": 1,4 "credits_remaining": 4999,5 "cached": false,6 "cached_at": null,7 "request_id": "req_c40c15da8712aea7c04078e6",8 "data": {9 "object": "list",10 "items": [11 {12 "object": "post",13 "platform": "twitter",14 "id": "2089382171291070550",15 "url": "https://x.com/public/status/2089382171291070550",16 "type": "tweet",17 "author": {18 "id": "4875271155",19 "handle": "public",20 "name": "Public",21 "url": "https://x.com/public",22 "avatar_url": "https://pbs.twimg.com/profile_images/2029954921500450820/TM-s7Olp_400x400.png",23 "verified": true24 },25 "title": null,26 "text": "BREAKING: New updates to AI Agents on Public\n\n→ We’ve launched the first-ever marketplace of AI Agents for your portfolio.\n→ Deploy them immediately or custo...",27 "published_at": "2026-08-17T16:01:43Z",28 "duration_seconds": 148.356,29 "language": "en",30 "hashtags": null,31 "mentions": null,32 "stats": {33 "views": null,34 "likes": 271,35 "comments": 58,36 "shares": null,37 "saves": null,38 "dislikes": null39 },40 "media": {41 "thumbnail_url": "https://pbs.twimg.com/amplify_video_thumb/2089380922604789760/img/YsvWjEQtSRL1BBVP.jpg",42 "video_url": "https://video.twimg.com/amplify_video/2089380922604789760/vid/avc1/1920x1080/_HrIDXI1YaM9p_0n.mp4",43 "audio_url": null,44 "image_urls": null,45 "width": 1920,46 "height": 108047 },48 "song": null,49 "location": null,50 "is_pinned": null,51 "is_sponsored": null,52 "extra": {53 "is_edited": false,54 "media": [55 {56 "duration_seconds": 148.356,57 "height": 1080,58 "type": "video",59 "url": "https://pbs.twimg.com/amplify_video_thumb/2089380922604789760/img/YsvWjEQtSRL1BBVP.jpg",60 "variants": [61 {62 "content_type": "application/x-mpegURL",63 "url": "https://video.twimg.com/amplify_video/2089380922604789760/pl/sILBlF5iBC0thC83.m3u8?v=7c0"64 },65 {66 "bitrate": 256000,67 "content_type": "video/mp4",68 "url": "https://video.twimg.com/amplify_video/2089380922604789760/vid/avc1/480x270/kcwI8ExpuWeSY-m-.mp4"69 },70 {71 "bitrate": 832000,72 "content_type": "video/mp4",73 "url": "https://video.twimg.com/amplify_video/2089380922604789760/vid/avc1/640x360/-n3gU9091zWRTKyv.mp4"74 }75 ],76 "width": 192077 }78 ],79 "possibly_sensitive": false,80 "source_shape": "syndication"81 }82 },83 {84 "object": "post",85 "platform": "twitter",86 "id": "2115190541688398184",87 "url": "https://x.com/AlexTamkin/status/2115190541688398184",88 "type": "tweet",89 "author": {90 "id": "846245360",91 "handle": "AlexTamkin",92 "name": "Alex Tamkin",93 "url": "https://x.com/AlexTamkin",94 "avatar_url": "https://pbs.twimg.com/profile_images/1971860057190207488/UVKmQfr-_400x400.jpg",95 "verified": true96 },97 "title": null,98 "text": "New Anthropic research: How AI agents shape experts' judgment calls\n\nWhen experts delegate work to an agent, do they still make the key decisions? We tested ...",99 "published_at": "2026-10-27T21:14:58Z",100 "duration_seconds": 15,101 "language": "en",102 "hashtags": null,103 "mentions": null,104 "stats": {105 "views": null,106 "likes": 4257,107 "comments": 314,108 "shares": null,109 "saves": null,110 "dislikes": null111 },112 "media": {113 "thumbnail_url": "https://pbs.twimg.com/amplify_video_thumb/2115181954740187136/img/iRp2D80CClkkY95v.jpg",114 "video_url": "https://video.twimg.com/amplify_video/2115181954740187136/vid/avc1/1600x900/jKk5QaS9zEkshd2n.mp4",115 "audio_url": null,116 "image_urls": null,117 "width": 1600,118 "height": 900119 },120 "song": null,121 "location": null,122 "is_pinned": null,123 "is_sponsored": null,124 "extra": {125 "is_edited": false,126 "media": [127 {128 "duration_seconds": 15,129 "height": 900,130 "type": "video",131 "url": "https://pbs.twimg.com/amplify_video_thumb/2115181954740187136/img/iRp2D80CClkkY95v.jpg",132 "variants": [133 {134 "content_type": "application/x-mpegURL",135 "url": "https://video.twimg.com/amplify_video/2115181954740187136/pl/jDXVoGQUDPWrcbuS.m3u8"136 },137 {138 "bitrate": 256000,139 "content_type": "video/mp4",140 "url": "https://video.twimg.com/amplify_video/2115181954740187136/vid/avc1/480x270/KSyXPnvgjKX-kAKb.mp4"141 },142 {143 "bitrate": 832000,144 "content_type": "video/mp4",145 "url": "https://video.twimg.com/amplify_video/2115181954740187136/vid/avc1/640x360/H9Ani75NyQGJZ0XQ.mp4"146 }147 ],148 "width": 1600149 }150 ],151 "possibly_sensitive": false,152 "source_shape": "syndication"153 }154 }155 ],156 "cursor": "eyJwIjoyLCJmIjp7InEiOiJhaSBhZ2VudHMgc2l0ZTp4LmNvbSBpbnVybDpzdGF0dXMiLCJzIjoiMTAiLCJuZXh0UGFyYW1zIjoiIiwidiI6ImwiLCJvIjoianNvbiIsImRjIjoiMTEiLCJhcGkiOiJkLmpzI...",157 "has_more": true,158 "parent": null159 },160 "cursor": "eyJwIjoyLCJmIjp7InEiOiJhaSBhZ2VudHMgc2l0ZTp4LmNvbSBpbnVybDpzdGF0dXMiLCJzIjoiMTAiLCJuZXh0UGFyYW1zIjoiIiwidiI6ImwiLCJvIjoianNvbiIsImRjIjoiMTEiLCJhcGkiOiJkLmpzI...",161 "has_more": true162}Fields
A page of results. Each entry in items is a Post. cursor and has_more page through the rest.
A field the platform does not give is null, never made up. Extra platform details are in extra.
| Field | Type | Always | Notes |
|---|---|---|---|
object | "post" | ||
platform | Platform | yes | |
id | string | yes | |
url | string or null | ||
type | "video" or "short" or "reel" or "image" or "carousel" or "story" or "live" or "clip" or "text" or "link" or "tweet" or "pin" or "community_post" or "episode" or "unknown" | ||
author | Author or null | ||
title | string or null | ||
text | string or null | ||
published_at | string (ISO 8601 date-time) or null | ||
duration_seconds | number or null | ||
language | string or null | ||
hashtags | string[] or null | ||
mentions | string[] or null | ||
stats | Stats |
Show the other 6 fields
Full field list in the reference for this endpoint and the data models. Errors are listed under Errors.
Questions
Which errors can it return?
invalid_params (do not retry), not_found (do not retry), upstream_blocked (retry). Account and platform errors from the errors list can also happen. A failure always costs 0 credits.
How do I get more than one page?
Send the same request with cursor set to the cursor you received, until has_more is false. Each page costs its own price. See pagination.
Is there an SDK call for it?
The Python client has client.twitter.search_posts(...) and the TypeScript client client.twitter.searchPosts(). Both return the same envelope as the HTTP API. Install them from PyPI (socialscrape-sdk) or npm (socialscrape); plain HTTP works in any language.
Can an AI agent call it?
Yes. The MCP server, which you run on your own machine, reaches every built endpoint, with the same prices.