Ali
Ali

Reputation: 77

how to get twitter top tweets in specific language?

With this url you can get the 100 best recent tweets which have the word 'ALI':

https://api.twitter.com/1.1/search/tweets.json?q=ALI&result_type=popular&count=100&lang=en

But how can we keep q empty ?

I just want to get the top tweets by language and not by keyword.

I tried to put space for the q but it didn't work.

Upvotes: 1

Views: 1192

Answers (1)

Yuri Schimke
Yuri Schimke

Reputation: 13458

Use a term like "lang:et" or "lang:ja". Most of the features are part of the "q" param instead of additional params.

You can generally experiment with search by going to Advanced Search and after you search copy the query out of the search bar at the top right of the page.

e.g. 1 Japanese tweets, using q=lang%3Aja

$ twitterapi '/1.1/search/tweets.json?q=lang%3Aja&result_type=popular&count=1' | jq .statuses[].text
"ぽい!ま〜きの"

Upvotes: 1

Related Questions