Skip to main content
POST
/
api
/
twitter
/
search
/
posts
/twitter/search/posts
curl --request POST \
  --url https://api.anysite.io/api/twitter/search/posts \
  --header 'Content-Type: application/json' \
  --header 'access-token: <access-token>' \
  --data '{
  "timeout": 300,
  "query": "crypto bitcoin",
  "exact_phrase": "btc trend",
  "any_of_these_words": [
    "crypto",
    "bitcoin",
    "ethereum"
  ],
  "none_of_these_words": [
    "scam",
    "fake"
  ],
  "these_hashtags": [
    "crypto",
    "bitcoin"
  ],
  "language": "English",
  "from_these_accounts": [
    "CoinDesk",
    "X"
  ],
  "to_these_accounts": [
    "CoinDesk",
    "X"
  ],
  "mentioning_these_accounts": [
    "@CoinDesk",
    "@X"
  ],
  "min_replies": 10,
  "min_likes": 100,
  "min_retweets": 50,
  "from_date": 1672531200,
  "to_date": 1704067200,
  "search_type": "Top",
  "count": 20
}'
[
  {
    "@type": "TwitterPost",
    "id": "<string>",
    "created_at": 123,
    "url": "<string>",
    "text": "<string>",
    "user": {
      "@type": "TwitterPostUser",
      "rest_id": "<string>",
      "name": "<string>",
      "alias": "<string>",
      "url": "<string>",
      "image": "<string>",
      "verified": false,
      "verified_type": "<string>",
      "is_blue_verified": false
    },
    "retweet_count": 0,
    "favorite_count": 0,
    "reply_count": 0,
    "quote_count": 0,
    "view_count": "<string>",
    "is_retweet": false,
    "retweeted": {},
    "is_quote": false,
    "quoted": {},
    "in_reply_to_status_id": "<string>",
    "in_reply_to_user_id": "<string>",
    "in_reply_to_screen_name": "<string>",
    "lang": "<string>",
    "source": "<string>",
    "possibly_sensitive": false,
    "medias": [],
    "urls": [],
    "hashtags": [],
    "user_mentions": [],
    "card": {
      "@type": "TwitterCardInfo",
      "title": "<string>",
      "description": "<string>",
      "domain": "<string>",
      "vanity_url": "<string>",
      "image_url": "<string>",
      "url": "<string>",
      "card_type": "<string>"
    },
    "poll": {
      "@type": "TwitterPoll",
      "choices": [],
      "ended_at": 123,
      "duration_minutes": 0,
      "is_final": false,
      "last_updated_at": 123
    }
  }
]

Headers

access-token
string
required

Body

application/json
count
integer
required

Max result count

Required range: x > 0
Examples:

20

timeout
integer
default:300

Max scrapping execution timeout (in seconds)

Required range: 20 <= x <= 1500
query
string
default:""

Main search query. Can include special operators like from:user, to:user, #hashtag, etc.

Examples:

"crypto bitcoin"

exact_phrase
string
default:""

Exact phrase (in quotes). Will be added as "phrase" to the query.

Examples:

"btc trend"

any_of_these_words
string[] | null

Any of these words (OR condition)

Examples:
["crypto", "bitcoin", "ethereum"]
none_of_these_words
string[] | null

None of these words (NOT condition)

Examples:
["scam", "fake"]
these_hashtags
string[] | null

These hashtags

Examples:
["crypto", "bitcoin"]
language
enum<string> | null

Language of tweets

Available options:
Arabic,
Arabic (Feminine),
Bangla,
Basque,
Bulgarian,
Catalan,
Croatian,
Czech,
Danish,
Dutch,
English,
Finnish,
French,
German,
Greek,
Gujarati,
Hebrew,
Hindi,
Hungarian,
Indonesian,
Italian,
Japanese,
Kannada,
Korean,
Marathi,
Norwegian,
Persian,
Polish,
Portuguese,
Romanian,
Russian,
Serbian,
Simplified Chinese,
Slovak,
Spanish,
Swedish,
Tamil,
Thai,
Traditional Chinese,
Turkish,
Ukrainian,
Urdu,
Vietnamese
Examples:

"English"

from_these_accounts
string[] | null

From these accounts

Examples:
["CoinDesk", "X"]
to_these_accounts
string[] | null

To these accounts

Examples:
["CoinDesk", "X"]
mentioning_these_accounts
string[] | null

Mentioning these accounts (username with @)

Examples:
["@CoinDesk", "@X"]
min_replies
integer | null

Minimum number of replies

Examples:

10

min_likes
integer | null

Minimum number of likes

Examples:

100

min_retweets
integer | null

Minimum number of retweets

Examples:

50

from_date
integer | null

Starting date for tweets search. Accepts timestamp

Required range: x > 1136073600
Examples:

1672531200

to_date
integer | null

Ending date for tweets search. Accepts timestamp

Required range: x > 1136073600
Examples:

1704067200

search_type
enum<string>

Type of search results

Available options:
Top,
Latest

Response

Successful Response

id
string
required
url
string
required
text
string
required
user
object
required
@type
string
default:TwitterPost
created_at
integer | null
retweet_count
integer
default:0
favorite_count
integer
default:0
reply_count
integer
default:0
quote_count
integer
default:0
view_count
string | null
is_retweet
boolean
default:false
retweeted
object | null
is_quote
boolean
default:false
quoted
object | null
in_reply_to_status_id
string | null
in_reply_to_user_id
string | null
in_reply_to_screen_name
string | null
lang
string | null
source
string | null
possibly_sensitive
boolean
default:false
medias
TwitterMedia · object[]
urls
TwitterUrl · object[]
hashtags
TwitterHashtag · object[]
user_mentions
TwitterPostUserMention · object[]
card
object | null
poll
object | null
I