1. Get an API key
The News API is distributed through RapidAPI. Subscribe and copy yourX-RapidAPI-Key from the dashboard.
The examples use
clair-news-api.p.rapidapi.com. Use the exact
X-RapidAPI-Host shown on the listing.2. Run a keyword search
Use familiar web-search syntax for phrases, alternatives, and exclusions:cURL
relevance_score is local to the current
query, not a probability.
3. Choose an ordering
The defaultsort_by=published_at returns matching articles newest first. This
is usually the right choice for monitoring.
Use relevance ordering when you want the strongest text matches first:
cURL
sort_by=relevance requires q. Both orderings use a stable ID tiebreaker.
4. Walk the newest articles
Omitq to read the canonical corpus newest first:
cURL
query and every relevance_score are null. Use it for polling,
incremental ingestion, or a local archive.
5. Filter by source
First list the active source names:cURL
exclude_sources instead when you want every source except the named
ones. You cannot send both filters in one request. An unknown name returns
unknown_source.
6. Page with the cursor
Whennext_cursor is not null, repeat the same request and pass it unchanged:
cURL
include_edits value. Changing them while reusing it returns bad_cursor.
Stop when next_cursor is null.
7. Handle content and revisions
content_available=false means Clair has neither a cleaned snippet nor a feed
excerpt for that item. content_truncated=true means the response contains the
first 2,000 characters. Clair does not expose a full-article archive.
The default response contains one canonical record per publisher URL. Add:
is_update=true.
Full News API reference
Every filter, response field, cursor rule, and error code.