
Twitter Scraper
This Actor is unavailable because the developer has decided to deprecate it. Would you like to try a similar Actor instead?
See alternative Actors
Twitter Scraper
Twitter Scraper searches and extracts data from Twitter (with historic data from 2006) - parses and converts the data to structured formats: HTML table, JSON, CSV, Excel and XML.
You can access the Twitter Scraper programmatically from your own applications by using the Apify API. You can choose the language preference from below. To use the Apify API, you’ll need an Apify account and your API token, found in Integrations settings in Apify Console.
1{
2 "openapi": "3.0.1",
3 "info": {
4 "version": "0.0",
5 "x-build-id": "f3O8cxqKA1Sj54JP1"
6 },
7 "servers": [
8 {
9 "url": "https://api.apify.com/v2"
10 }
11 ],
12 "paths": {
13 "/acts/microworlds~twitter-scraper/run-sync-get-dataset-items": {
14 "post": {
15 "operationId": "run-sync-get-dataset-items-microworlds-twitter-scraper",
16 "x-openai-isConsequential": false,
17 "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
18 "tags": [
19 "Run Actor"
20 ],
21 "requestBody": {
22 "required": true,
23 "content": {
24 "application/json": {
25 "schema": {
26 "$ref": "#/components/schemas/inputSchema"
27 }
28 }
29 }
30 },
31 "parameters": [
32 {
33 "name": "token",
34 "in": "query",
35 "required": true,
36 "schema": {
37 "type": "string"
38 },
39 "description": "Enter your Apify token here"
40 }
41 ],
42 "responses": {
43 "200": {
44 "description": "OK"
45 }
46 }
47 }
48 },
49 "/acts/microworlds~twitter-scraper/runs": {
50 "post": {
51 "operationId": "runs-sync-microworlds-twitter-scraper",
52 "x-openai-isConsequential": false,
53 "summary": "Executes an Actor and returns information about the initiated run in response.",
54 "tags": [
55 "Run Actor"
56 ],
57 "requestBody": {
58 "required": true,
59 "content": {
60 "application/json": {
61 "schema": {
62 "$ref": "#/components/schemas/inputSchema"
63 }
64 }
65 }
66 },
67 "parameters": [
68 {
69 "name": "token",
70 "in": "query",
71 "required": true,
72 "schema": {
73 "type": "string"
74 },
75 "description": "Enter your Apify token here"
76 }
77 ],
78 "responses": {
79 "200": {
80 "description": "OK",
81 "content": {
82 "application/json": {
83 "schema": {
84 "$ref": "#/components/schemas/runsResponseSchema"
85 }
86 }
87 }
88 }
89 }
90 }
91 },
92 "/acts/microworlds~twitter-scraper/run-sync": {
93 "post": {
94 "operationId": "run-sync-microworlds-twitter-scraper",
95 "x-openai-isConsequential": false,
96 "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
97 "tags": [
98 "Run Actor"
99 ],
100 "requestBody": {
101 "required": true,
102 "content": {
103 "application/json": {
104 "schema": {
105 "$ref": "#/components/schemas/inputSchema"
106 }
107 }
108 }
109 },
110 "parameters": [
111 {
112 "name": "token",
113 "in": "query",
114 "required": true,
115 "schema": {
116 "type": "string"
117 },
118 "description": "Enter your Apify token here"
119 }
120 ],
121 "responses": {
122 "200": {
123 "description": "OK"
124 }
125 }
126 }
127 }
128 },
129 "components": {
130 "schemas": {
131 "inputSchema": {
132 "type": "object",
133 "properties": {
134 "searchTerms": {
135 "title": "What search terms do you want to scrape?",
136 "type": "array",
137 "description": "If you add search terms, the scraper will find and extract tweets that mention those terms. Alternatively, see further down to scrape by Twitter URL.",
138 "items": {
139 "type": "string"
140 }
141 },
142 "searchMode": {
143 "title": "Do you want to filter by content?",
144 "enum": [
145 "top",
146 "live"
147 ],
148 "type": "string",
149 "description": "This setting will change how the data is received by the scraper. Setting it to latest yields more results.",
150 "default": "live"
151 },
152 "maxTweets": {
153 "title": "Maximum number of tweets",
154 "type": "integer",
155 "description": "This value lets you set the maximum number of tweets to retrieve. Twitter has a default limit of around 800 tweets per query. Check the README for workarounds.",
156 "default": 1000
157 },
158 "maxTweetsPerQuery": {
159 "title": "Maximum number of tweets per query",
160 "type": "integer",
161 "description": "This value lets you set the maximum number of tweets to retrieve per query.",
162 "default": 1000
163 },
164 "maxRequestRetries": {
165 "title": "Number of request retries",
166 "maximum": 6,
167 "type": "integer",
168 "description": "Number of times to retry when the run fails.",
169 "default": 6
170 },
171 "addUserInfo": {
172 "title": "Add user information",
173 "type": "boolean",
174 "description": "Appends an object to each tweet containing the user information. You can decrease the size of your dataset by turning this off.",
175 "default": true
176 },
177 "scrapeTweetReplies": {
178 "title": "Scrape tweet replies",
179 "type": "boolean",
180 "description": "Enable if you want to extract both tweet details and the replies. Disabling it will return only the tweet details, no replies.",
181 "default": true
182 },
183 "sinceDate": {
184 "title": "Tweets from this date",
185 "pattern": "(\\d{4}-\\d{2}-\\d{2}|(\\d+)\\s?\\S+)",
186 "type": "string",
187 "description": "Scrape tweets starting from this date"
188 },
189 "untilDate": {
190 "title": "Tweets until this date",
191 "pattern": "(\\d{4}-\\d{2}-\\d{2}|(\\d+)\\s?\\S+)",
192 "type": "string",
193 "description": "Scrape tweets until this date"
194 },
195 "handle": {
196 "title": "Do you want to scrape by Twitter handle?",
197 "type": "array",
198 "description": "You can add the twitter handles of specific profiles you want to scrape. This is a shortcut so that you don't have to add full username URLs like https://twitter.com/apify.",
199 "items": {
200 "type": "string"
201 }
202 },
203 "urls": {
204 "title": "Do you want to scrape by Twitter URL?",
205 "type": "array",
206 "description": "This lets you tell the scraper where to start. You can enter Twitter URLs one by one. You can also link to or upload a text file with a list of URLs",
207 "items": {
208 "type": "string"
209 }
210 }
211 }
212 },
213 "runsResponseSchema": {
214 "type": "object",
215 "properties": {
216 "data": {
217 "type": "object",
218 "properties": {
219 "id": {
220 "type": "string"
221 },
222 "actId": {
223 "type": "string"
224 },
225 "userId": {
226 "type": "string"
227 },
228 "startedAt": {
229 "type": "string",
230 "format": "date-time",
231 "example": "2025-01-08T00:00:00.000Z"
232 },
233 "finishedAt": {
234 "type": "string",
235 "format": "date-time",
236 "example": "2025-01-08T00:00:00.000Z"
237 },
238 "status": {
239 "type": "string",
240 "example": "READY"
241 },
242 "meta": {
243 "type": "object",
244 "properties": {
245 "origin": {
246 "type": "string",
247 "example": "API"
248 },
249 "userAgent": {
250 "type": "string"
251 }
252 }
253 },
254 "stats": {
255 "type": "object",
256 "properties": {
257 "inputBodyLen": {
258 "type": "integer",
259 "example": 2000
260 },
261 "rebootCount": {
262 "type": "integer",
263 "example": 0
264 },
265 "restartCount": {
266 "type": "integer",
267 "example": 0
268 },
269 "resurrectCount": {
270 "type": "integer",
271 "example": 0
272 },
273 "computeUnits": {
274 "type": "integer",
275 "example": 0
276 }
277 }
278 },
279 "options": {
280 "type": "object",
281 "properties": {
282 "build": {
283 "type": "string",
284 "example": "latest"
285 },
286 "timeoutSecs": {
287 "type": "integer",
288 "example": 300
289 },
290 "memoryMbytes": {
291 "type": "integer",
292 "example": 1024
293 },
294 "diskMbytes": {
295 "type": "integer",
296 "example": 2048
297 }
298 }
299 },
300 "buildId": {
301 "type": "string"
302 },
303 "defaultKeyValueStoreId": {
304 "type": "string"
305 },
306 "defaultDatasetId": {
307 "type": "string"
308 },
309 "defaultRequestQueueId": {
310 "type": "string"
311 },
312 "buildNumber": {
313 "type": "string",
314 "example": "1.0.0"
315 },
316 "containerUrl": {
317 "type": "string"
318 },
319 "usage": {
320 "type": "object",
321 "properties": {
322 "ACTOR_COMPUTE_UNITS": {
323 "type": "integer",
324 "example": 0
325 },
326 "DATASET_READS": {
327 "type": "integer",
328 "example": 0
329 },
330 "DATASET_WRITES": {
331 "type": "integer",
332 "example": 0
333 },
334 "KEY_VALUE_STORE_READS": {
335 "type": "integer",
336 "example": 0
337 },
338 "KEY_VALUE_STORE_WRITES": {
339 "type": "integer",
340 "example": 1
341 },
342 "KEY_VALUE_STORE_LISTS": {
343 "type": "integer",
344 "example": 0
345 },
346 "REQUEST_QUEUE_READS": {
347 "type": "integer",
348 "example": 0
349 },
350 "REQUEST_QUEUE_WRITES": {
351 "type": "integer",
352 "example": 0
353 },
354 "DATA_TRANSFER_INTERNAL_GBYTES": {
355 "type": "integer",
356 "example": 0
357 },
358 "DATA_TRANSFER_EXTERNAL_GBYTES": {
359 "type": "integer",
360 "example": 0
361 },
362 "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
363 "type": "integer",
364 "example": 0
365 },
366 "PROXY_SERPS": {
367 "type": "integer",
368 "example": 0
369 }
370 }
371 },
372 "usageTotalUsd": {
373 "type": "number",
374 "example": 0.00005
375 },
376 "usageUsd": {
377 "type": "object",
378 "properties": {
379 "ACTOR_COMPUTE_UNITS": {
380 "type": "integer",
381 "example": 0
382 },
383 "DATASET_READS": {
384 "type": "integer",
385 "example": 0
386 },
387 "DATASET_WRITES": {
388 "type": "integer",
389 "example": 0
390 },
391 "KEY_VALUE_STORE_READS": {
392 "type": "integer",
393 "example": 0
394 },
395 "KEY_VALUE_STORE_WRITES": {
396 "type": "number",
397 "example": 0.00005
398 },
399 "KEY_VALUE_STORE_LISTS": {
400 "type": "integer",
401 "example": 0
402 },
403 "REQUEST_QUEUE_READS": {
404 "type": "integer",
405 "example": 0
406 },
407 "REQUEST_QUEUE_WRITES": {
408 "type": "integer",
409 "example": 0
410 },
411 "DATA_TRANSFER_INTERNAL_GBYTES": {
412 "type": "integer",
413 "example": 0
414 },
415 "DATA_TRANSFER_EXTERNAL_GBYTES": {
416 "type": "integer",
417 "example": 0
418 },
419 "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
420 "type": "integer",
421 "example": 0
422 },
423 "PROXY_SERPS": {
424 "type": "integer",
425 "example": 0
426 }
427 }
428 }
429 }
430 }
431 }
432 }
433 }
434 }
435}
Twitter Scraper OpenAPI definition
OpenAPI is a standard for designing and describing RESTful APIs, allowing developers to define API structure, endpoints, and data formats in a machine-readable way. It simplifies API development, integration, and documentation.
OpenAPI is effective when used with AI agents and GPTs by standardizing how these systems interact with various APIs, for reliable integrations and efficient communication.
By defining machine-readable API specifications, OpenAPI allows AI models like GPTs to understand and use varied data sources, improving accuracy. This accelerates development, reduces errors, and provides context-aware responses, making OpenAPI a core component for AI applications.
You can download the OpenAPI definitions for Twitter Scraper from the options below:
If you’d like to learn more about how OpenAPI powers GPTs, read our blog post.
You can also check out our other API clients: