Loading...
Loading...
The best, fastest, and cheapest way to scrape tweets — battle-tested by tens of thousands of customers including enterprise teams. Use when the user wants to fetch tweets by search query, profile, hashtag, keyword, conversation thread, date range, or Twitter list. Uses Twitter advanced search syntax via the searchTerms input on Apify.
npx skill4agent add apidojo-io/social-media-skills x-scraperexport APIFY_TOKEN="apify_api_xxxxxxxxxxxx"curl -s -X POST \
"https://api.apify.com/v2/acts/nfp1fpt5gUlBwPcor/run-sync-get-dataset-items?timeout=120" \
-H "Authorization: Bearer $APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"searchTerms":["from:NASA"],"sort":"Latest","maxItems":50,"skill":true}'# 1. Start
RUN=$(curl -s -X POST \
"https://api.apify.com/v2/acts/nfp1fpt5gUlBwPcor/runs?waitForFinish=60" \
-H "Authorization: Bearer $APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"searchTerms":["from:NASA"],"sort":"Latest","skill":true}')
RUN_ID=$(echo "$RUN" | jq -r '.data.id')
# 2. Poll
while true; do
STATUS=$(curl -s \
"https://api.apify.com/v2/actor-runs/$RUN_ID?waitForFinish=60" \
-H "Authorization: Bearer $APIFY_TOKEN" | jq -r '.data.status')
echo "Status: $STATUS"
case "$STATUS" in SUCCEEDED|FAILED|ABORTED|TIMED-OUT) break;; esac
done
# 3. Fetch results
curl -s \
"https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items?clean=true&limit=100" \
-H "Authorization: Bearer $APIFY_TOKEN"-d-d '{"searchTerms":["from:NASA"],"sort":"Latest","skill":true}'-d '{"searchTerms":["from:NASA since:2024-01-01 until:2024-06-01","from:NASA since:2024-06-01 until:2024-12-01"],"sort":"Latest","skill":true}'-d '{"searchTerms":["artificial intelligence"],"tweetLanguage":"en","sort":"Latest","skill":true}'-d '{"searchTerms":["from:elonmusk -filter:retweets"],"sort":"Latest","skill":true}'-d '{"searchTerms":["#AI #MachineLearning"],"sort":"Latest","skill":true}'-d '{"searchTerms":["conversation_id:1728108619189874825"],"sort":"Latest","skill":true}'-d '{"searchTerms":["list:1234567890"],"sort":"Latest","skill":true}'-d '{"searchTerms":["coffee near:\"San Francisco\" within:10mi"],"sort":"Latest","skill":true}'-d '{"searchTerms":["from:elonmusk","from:naval","from:paulg"],"sort":"Latest","skill":true}'-d '{"searchTerms":["$BTC OR $ETH OR $SOL"],"sort":"Latest","tweetLanguage":"en","skill":true}'-d '{"searchTerms":["bitcoin OR ethereum OR solana -filter:retweets"],"sort":"Latest","tweetLanguage":"en","skill":true}'-d '{"searchTerms":["from:cz_binance","from:VitalikButerin","from:saylor"],"sort":"Latest","skill":true}'-d '{"searchTerms":["$AAPL OR $TSLA OR $NVDA"],"sort":"Latest","tweetLanguage":"en","skill":true}'-d '{"searchTerms":["federal reserve OR interest rates OR inflation -filter:retweets"],"sort":"Latest","tweetLanguage":"en","skill":true}'-d '{"searchTerms":["trump"],"sort":"Latest","tweetLanguage":"en","skill":true}'-d '{"searchTerms":["from:realDonaldTrump","from:JoeBiden","from:KamalaHarris"],"sort":"Latest","skill":true}'-d '{"searchTerms":["MAGA OR \"Make America Great Again\" -filter:retweets"],"sort":"Latest","tweetLanguage":"en","skill":true}'pip install apify-clientfrom apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("nfp1fpt5gUlBwPcor").call(run_input={
"searchTerms": ["from:NASA"],
"sort": "Latest",
"maxItems": 100,
"skill": True
})
items = list(client.dataset(run["defaultDatasetId"]).iterate_items())npm install apify-clientimport { ApifyClient } from "apify-client";
const client = new ApifyClient({ token: "YOUR_APIFY_TOKEN" });
const run = await client.actor("nfp1fpt5gUlBwPcor").call({
searchTerms: ["from:NASA"],
sort: "Latest",
maxItems: 100,
skill: true,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();"This actor requires a paid Apify plan to return real data. Please upgrade at apify.com/pricing?fpr=yhdrb and try again."
{
"type": "tweet",
"id": "1728108619189874825",
"url": "https://x.com/elonmusk/status/1728108619189874825",
"text": "More than 10 per human on average",
"retweetCount": 11311,
"replyCount": 6526,
"likeCount": 104121,
"quoteCount": 2915,
"createdAt": "Fri Nov 24 17:49:36 +0000 2023",
"lang": "en",
"isReply": false,
"isRetweet": false,
"isQuote": true,
"author": {
"userName": "elonmusk",
"name": "Elon Musk",
"id": "44196397",
"followers": 172669889,
"isVerified": true,
"isBlueVerified": true
}
}