Keyword Search
Create searches for keywords, hashtags, or usernames across multiple platforms.
POST /api/iq/keyword_search
Parameters
| query | Required — keyword-based search (supports AND/OR/NOT and parentheses) |
| start_date | Optional — default: one week before current date. A date, YYYY-MM-DD, read as a whole UTC day. On a search of X only (platforms: ["twitter"]) it can instead be a Unix timestamp in seconds, a number such as 1794747600, to search down to the second. A date with a time, such as 2026-11-15T13:00:00Z, is read as its day. |
| end_date | Optional — default: current date. Same formats as start_date; a date includes that whole day, a Unix timestamp is the exact end of the window. When one of the two is a Unix timestamp the other must be one too. A search of any other platform takes dates only and answers a timestamp with a 400. |
| platforms | Optional — array of platforms. Default: ["twitter","reddit","bluesky","youtube","facebook","instagram","threads"]. Facebook, Instagram and LinkedIn are searched on the account's own connected session: without one the platform is left out and coverage says why. LinkedIn is not in the default and can be combined with any other platform. TikTok works the same way as LinkedIn: on the account's own connected session, not in the default. Allowed values: twitter, reddit, bluesky, youtube, threads, facebook, instagram, linkedin, tiktok |
| max_post | Optional — maximum number of posts per platform searched. Default: 100, which is also the most a search takes, except a search of X only (platforms: ["twitter"]), which takes up to 1000. A larger number is lowered to the limit. |
| sort_by | Optional — the order X posts are collected in, which decides which posts a search returns when there are more than max_post. "engagement" returns the most engaged posts of the period; do not add min_faves: to the query with it, as the threshold is set for you. "time" returns the most recent posts; add min_faves:N to the query to set your own threshold. Any other value is answered with a 400. |
| sentiment_target | Optional — what each post's sentiment is measured towards, for example "data centers". Without it the AI analysis picks a target from the posts. Each post reports the target used in its sentiment_target field. Has no effect with enable_ai: false. |
| enable_ai | Optional — true (default) runs the AI analysis: sentiment, summaries and the topic tree. Pass false to collect the posts only, which is faster; use it when you run your own analysis on the posts. Such a search has no results and no topic tree: read its posts from posts_data. Every response for the search carries enable_ai. |
Request Example
curl -X POST "https://rolli.ai/api/iq/keyword_search" \
-H "X-ROLLI-TOKEN: your_token" \
-H "X-ROLLI-USER-ID: your_user_id" \
-H "Content-Type: application/json" \
-d '{
"query": "AI election integrity",
"start_date": "2025-07-01",
"end_date": "2025-07-07",
"max_post": 100,
"platforms": [
"twitter",
"reddit",
"bluesky",
"youtube"
]
}'
fetch("https://rolli.ai/api/iq/keyword_search", {
method: "POST",
headers: {
"X-ROLLI-TOKEN": "your_token",
"X-ROLLI-USER-ID": "your_user_id",
"Content-Type": "application/json"
},
body: JSON.stringify({"query":"AI election integrity","start_date":"2025-07-01","end_date":"2025-07-07","max_post":100,"platforms":["twitter","reddit","bluesky","youtube"]})
})
.then(res => res.json())
.then(console.log);
require "net/http"
require "uri"
require "json"
uri = URI("https://rolli.ai/api/iq/keyword_search")
req = Net::HTTP::Post.new(uri)
req["X-ROLLI-TOKEN"] = "your_token"
req["X-ROLLI-USER-ID"] = "your_user_id"
req["Content-Type"] = "application/json"
req.body = {"query":"AI election integrity","start_date":"2025-07-01","end_date":"2025-07-07","max_post":100,"platforms":["twitter","reddit","bluesky","youtube"]}.to_json
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(req)
end
puts res.body
import requests
import json
url = "https://rolli.ai/api/iq/keyword_search"
headers = {
"X-ROLLI-TOKEN": "your_token",
"X-ROLLI-USER-ID": "your_user_id",
"Content-Type": "application/json"
}
payload = {
"query": "AI election integrity",
"start_date": "2025-07-01",
"end_date": "2025-07-07",
"max_post": 100,
"platforms": [
"twitter",
"reddit",
"bluesky",
"youtube"
]
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
Response Example
{
"id": 1241,
"query": "an example query",
"enable_ai": true,
"created_at": "2023-10-01T12:00:00Z",
"updated_at": "2023-10-01T12:00:00Z"
}
Intelligent analysis features (metrics, sentiment, coordination) are available for Twitter only.
Coverage
Every search response, the list endpoint and the return_url callback carry coverage and
notices. When a requested platform could not be searched, the search still runs on the others, and
coverage says which platform was left out and why. Both fields are additive; clients that ignore them
keep working.
| Field Name | Description |
|---|---|
| coverage | One entry per requested platform: {"status": "searched"}, or {"status": "excluded", "reason": "<code>"}. A platform searched on a connected session that found nothing also carries "note": "no_posts" |
| notices | The same in plain language, one sentence per platform left out or noted, ready to show to your users |
Reason Codes
| Reason | Meaning |
|---|---|
| not_connected | The platform needs a connection the account has not made |
| needs_reconnect | The account's connection for the platform expired; the account owner needs to reconnect it |
| restricted | The platform restricted the connected account |
| rate_limited | The connection reached its daily search limit; searches resume at 00:00 UTC |
| disabled_by_admin | Searching the platform this way is switched off for now |
| not_available | Not available for this account |
| provider_error | The data provider did not respond for this platform |
Example
{
"coverage": {
"twitter": { "status": "searched" },
"reddit": { "status": "searched" },
"instagram": { "status": "excluded", "reason": "not_connected" }
},
"notices": [
"Instagram was not searched: not connected. The account owner can connect it in the Rolli API panel."
]
}
When none of the requested platforms can be searched, the request is answered 422 with
coverage and notices, and nothing is charged.