# Social Media Search API: Pay Once, Then Page Rows Free (https://www.socialcrawl.dev/blog/universal-search-more-usable-rows) > Build on a social media search API: page a stored run for free, poll for only new rows, send 100 searches in one request, schedule watches, enrich rows later. A social media search API takes one query, searches many platforms at once and returns one ranked list. SocialCrawl's is `GET /v1/search/everywhere`, at a flat 20 credits a search. Every search made with an API key is stored as a run, and most of what you build after the first answer reads that run instead of searching again. From that run you can page rows for free, poll for rows you have not seen, send a list of searches in one request, schedule a watch and add comments or author profiles to rows you already hold. For the single call, what each row holds and what `partial` means, read the [social media search engine guide](/blog/social-search-engine). Blank search-result cards fanning out of one keyhole, the ranked rows a social media search API returns from a single query. ## What does the first call give you to build on? Price the request with `dry_run=1`, which costs nothing and returns the plan, the credit estimate and the refund rule. Then send it for real with `format=compact`, the shape meant for code and agents. ```bash curl "https://www.socialcrawl.dev/v1/search/everywhere?query=standing%20desk&period=30d&format=compact&limit=20&deadline_s=25" \ -H "x-api-key: $SOCIALCRAWL_API_KEY" ``` Besides `data.items`, the answer carries `data.run` (the `run_id`, its `status` and what it cost) and `data.next`, a block of URLs for what you can do next with the stored search. These are the ones you will use most: | Field in `data.next` | What it is for | | --- | --- | | `status_url` | Waits on a run that was still `running` when `deadline_s` passed. | | `results_url` | Every stored row as JSON lines, free. | | `watermark` | Send it back as `since_watermark` to get only rows this answer did not deliver. | | `watch` | A ready request body that turns this search into a scheduled watch. | | `include_url` | Adds comments, author profiles or page text to stored rows. | | `more_url` | Searches the next page of every source that has one. | `limit` trims the answer, 1 to 100 rows. The run can store more rows than you asked for, and `data.summary.stored` says how many. `data.next_step` is one sentence on what to send next, and an agent can relay it as is. ## How do you read more rows without paying again? Page the run. `pagination.next_cursor` from the first answer goes to `GET /v1/search/everywhere/runs/{run_id}`, and every page is free. A read answers in `format=evidence` unless you say otherwise, and `page_size` defaults to 50, so send `format=compact&page_size=20` to keep pages the same shape as the first one. ```python BASE = "https://www.socialcrawl.dev/v1/search/everywhere" HEADERS = {"x-api-key": os.environ["SOCIALCRAWL_API_KEY"]} first = requests.get( BASE, params={"query": "standing desk", "period": "30d", "format": "compact", "limit": 20, "deadline_s": 25}, headers=HEADERS, timeout=60, ).json() run_id = first["data"]["run"]["run_id"] rows = list(first["data"]["items"]) cursor = first["pagination"]["next_cursor"] while cursor: page = requests.get( f"{BASE}/runs/{run_id}", params={"cursor": cursor, "format": "compact", "page_size": 20}, headers=HEADERS, timeout=60, ).json() rows += page["data"]["items"] cursor = page["pagination"]["next_cursor"] if page["pagination"]["has_more"] else None ``` If the first answer says `status: "running"`, read `data.next.status_url` until it says `completed` before you page. Never resend the search while it runs, because an identical second request is a second search unless it carries the same [`Idempotency-Key`](/docs/idempotency). Three other free reads help when you build a pipeline. `results_url` streams every stored row as JSON lines, and its last line is `{"complete": true}` when nothing is left. `GET /v1/search/everywhere/runs` lists your runs, newest first, if you lose a `run_id`. And an identical request inside 120 seconds is answered from the shared cache for 0 credits. A run is kept for 30 days and only your own account's keys can read it. Rows deep in a run rank lower and are judged less, so stop paging when a row's `why.level` no longer names your subject. ## How do you get only the posts you have not seen? Send the last answer's `data.next.watermark` back as `since_watermark` on the same request. Rows that answer already delivered are left out. Inside the 120-second cache window the poll is free and returns the next rows of the stored answer. After the window it is a new search at 20 credits, and if nothing is new the answer says `empty_reason: "already_delivered"`. A watermark belongs to the request and the key that received it. Send it with a different query and you get a free `400` with `watermark_mismatch`. Use this when your own scheduler decides when to poll. When you would rather have SocialCrawl run the schedule, use a watch. ## How do you send a list of searches in one request? `POST /v1/search/everywhere` takes `queries`, up to 100 phrases, or `groups`, up to 100 searches that each carry their own query, platforms, window and `tags`. Each search costs 20 credits, and `max_credits` is required. ```bash curl -X POST "https://www.socialcrawl.dev/v1/search/everywhere" \ -H "x-api-key: $SOCIALCRAWL_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{"queries":["standing desk","ergonomic chair","monitor arm"],"period":"7d","max_credits":60}' ``` The list runs in the background. You get a `202` with `data.groups` and a `status_url`, and you read the finished list like any stored run, with `group=` to narrow it to one search. A row that several searches found appears once, with `also_in_groups` naming the others. A cap that cannot cover the list is refused for free before anything runs. Three searches with `max_credits: 20` come back as a `400` with `max_credits_below_estimate` and `suggested_max_credits: 60`. A list that reaches its cap or your balance pauses with a `resume_url`, and searches already paid for are not charged again. ## How do you turn a search into a scheduled watch? Add `schedule` to the POST body, or take the ready body from `data.next.watch`. `every` is `1h`, `6h`, `12h`, `1d`, `7d` or `30d`, and `max_credits_per_run` caps each run. ```json { "query": "standing desk", "platforms": ["reddit", "youtube", "tiktok"], "schedule": { "every": "1d", "max_credits_per_run": 20, "name": "desk watch" } } ``` Send it with `"dry_run": true` first. The answer adds `data.schedule` with `credits_per_fire`, `fires_per_30_days` and `credits_per_30_days`, so a daily watch of one search shows 30 fires and 600 credits over 30 days before you create it. A fire costs what the same call costs, with no surcharge for scheduling. The first run is the baseline and marks its rows `baseline: true`. Each later run stores only rows the watch never delivered. A run with new rows sends a `discover.new_items` event to [`GET /v1/events`](/docs/events) and to your [webhook endpoints](/docs/webhook-endpoints), so you do not have to poll. A watch runs at most hourly, and it must not follow a private individual: topics, brands, organisations and people in a public role are fine. ## How do you add comments or author data after the search? `POST /v1/search/everywhere/runs/{run_id}/include` writes extra data into rows the run already holds, so you enrich a record instead of searching again. The top 10 rows already carry up to 15 comments each at no extra charge. Comments beyond that, replies, author profiles and full page text are billed at the public price of the calls they make. | Extra | Example reads | Credits | | --- | --- | --- | | `comments` | TikTok, YouTube, X or Facebook comments | 1 per page of comments | | `comments` | Instagram, Reddit or LinkedIn comments | 5 per page of comments | | `authors` | TikTok, Instagram, YouTube or X profiles | 1 per author | | `body` | Full text of a web page row | 1 per page read | Send `"dry_run": true` in the body to get the quote. A read that fails or fills nothing is refunded. The [docs](/docs/search/everywhere) list every platform and price. When the stored rows run out, `POST .../runs/{run_id}/more` searches the next page of every source that reported one, on the same run. It costs 20 credits per search with another page, and a source with no next page costs nothing. Use [Discover](/docs/prism/discover) instead when you need many pages per platform from the start. ## How do you narrow the search by language, country or speed? These fields change what each search asks, and a dry run shows the price before you send them: - `languages` takes 1 to 4 language codes. Each language is its own search, so `languages=ko,ja` on one query costs 40 credits. - `country` takes 1 to 10 country codes at no extra cost, and `unknown_country` decides what a row with no known country does. - `keywords` takes up to 6 phrasings of one question, each its own search, merged into one list. Send `context` beside it to say what rows are judged against. - `depth=quick` searches X, YouTube, TikTok and the web only, with a 10-second deadline, at the same 20 credits. Naming Reddit with it is a free `400` that lists the four platforms it covers. - `platforms` and `exclude_platforms` narrow the default set. Name `bluesky`, `news` or `quora` to add them, which widens one search to up to 18 platforms. ## What does a social media search API cost here? The search is the only thing you pay a flat price for. Reading what it stored is free. | What you send | Credits | | --- | --- | | One search | 20 | | Each extra keyword, language, list search, watch run or `more` page | 20 each | | Dry run, paging a run, `results.jsonl`, the runs list, a cache hit | 0 | | A search where most of the called sources failed but some rows came back | 10 | | A search with no rows anywhere | 0 | | Follow-ups with `include` | The public price of each read | See [credits](/docs/credits) for how the balance works across the API. ## What does the search not do? - Each source returns one page of its own search at the moment of the call, so two searches minutes apart can differ. The stored run is the stable record, and `more` or Discover reads further. - A window such as `period=30d` drops rows outside it, but it cannot make a platform return older posts than its search holds, so a long window can come back thin. - It searches a fixed set of sources, listed in the [docs](/docs/search/everywhere), and only public posts. It does not read private, logged-in or deleted content. - A source that is failing is skipped and named in `data.platforms` and `data._warnings`, and the rest of the answer still returns. For what universal search covers and how the ranking works, see the [universal search page](/universal-search). ## Frequently asked questions ### How much does one social media search cost? A search is a flat 20 credits, however many sources answer. Each extra keyword, language, list search, watch run or `more` page is another 20. Dry runs, page reads, `results.jsonl` and cache hits are free. ### How do I get more than 100 rows from one search? Page the stored run with `pagination.next_cursor` on `GET /v1/search/everywhere/runs/{run_id}`, which is free. When the stored rows run out, `POST .../runs/{run_id}/more` searches the next page of each source for 20 credits per search. ### How do I get only new posts since my last call? Send the last answer's `data.next.watermark` as `since_watermark` on the same request. Rows already delivered are left out. For a schedule run on our side, turn the search into a watch with `schedule`. ### Can I run many searches in one request? Yes. `POST /v1/search/everywhere` takes up to 100 phrases in `queries`, or up to 100 `groups` with their own settings. It needs `max_credits` and runs in the background. ### How long is a search stored? A run is stored for 30 days, and only the keys of the account that made it can read it. After that the run answers `410 RUN_EXPIRED`.