Twitter Scraper avatar
Twitter Scraper

Deprecated

Pricing

$1.50 / 1,000 tweets

Go to Store
Twitter Scraper

Twitter Scraper

Deprecated

Developed by

Caleb David

Maintained by Community

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.

5.0 (1)

Pricing

$1.50 / 1,000 tweets

61

Total users

13.2k

Monthly users

41

Runs succeeded

>99%

Last modified

7 months ago

KI

How to limit my search query for particular region e.g. India

Closed

kishore.paluri opened this issue
a year ago

How to limit my search query for particular region e.g. India instead of extracting data from all over world for keyword/hashtag.

microworlds avatar

You can use the lang operator on searches. See example:

1{
2  "addUserInfo": true,
3  "maxRequestRetries": 5,
4  "maxTweets": 100,
5  "maxTweetsPerQuery": 100,
6  "scrapeTweetReplies": true,
7  "searchMode": "live",
8  "searchTerms": [
9    "#gpt (lang:hi)"
10  ]
11}

Sample run - https://console.apify.com/view/runs/VkyOa6E6mwT60v0Sb

KI

kishore.paluri

a year ago

If i have the lang operator in search, tweets will be filtered written in that language but not the users in that language. My question is how can i filter the tweets only from Indian users irrespective of writing in English or Hindi or any other language

microworlds avatar

Oh, I get. You can use the near, place, geocode, place, within operators. Please look up this documentation - https://github.com/igorbrigadir/twitter-advanced-search and check the "Geo" section. Please note that pulling tweets for the exact location might not always be 100% accurate.

KI

kishore.paluri

a year ago

I'm trying to extract data with country code ("country_code":"in"), but it is extracting all locations data. Here is the documentation i followed to restrict data with country code https://developer.twitter.com/en/docs/twitter-api/v1/data-dictionary/object-model/geo#place

microworlds avatar

Sorry, the documentation is not similar to the one I provided. Unfortunately, the actor only works with docs I shared 😢

KI

kishore.paluri

a year ago

Hi David, Document I have provided is extension to the one you have provided only. With in the document you have provided, if you can go to Geo -> Place -> Search tweets by Place Object ID eg: USA Place ID. There you have link to know, how we can provide place object ID. Could you please check and let me know how i can filter only India region tweets. Thanks in advance. Regards, Kishore

KI

kishore.paluri

a year ago

I have also tried extracting the data using geocode, but it still give results from other regions. Below is the piece of code i have used. latitude = 20.5937 longitude = 78.9629 max_range = 1000 # this is the maximum range in kilometers geocode = "%f,%f,%dkm" % (latitude, longitude, max_range)

microworlds avatar

Sorry, location filters are inherently unstable. The actor only tries to pull results at best efforts. The accuracy is not guaranteed, sadly 😢