Overview
Authentication, pagination and errors, shared by every route.
The pages in this section are generated from the same zod schemas the API
validates its requests and responses against, so they always match what
the API does. The raw spec is served at /v1/openapi.json.
Authentication
Send your API key as a bearer token on every request:
curl https://api.newsfilter.dev/v1/stories?ticker=ACME \
-H "Authorization: Bearer $NEWSFILTER_KEY"A missing, unknown or revoked key answers 401.
Any authenticated app can read the shared news for every ticker newsfilter covers. Your subscriptions decide which tickers' webhooks and catch-up events you receive; they don't limit what you can read.
Pagination
List routes return a page:
{ "data": [], "next_cursor": "…" }Pass next_cursor back as cursor for the next page. It is null on the
last page. limit is 1 to 200, 50 by default.
Catch-up pages differently, since it never reaches a last page:
{ "data": [], "next_cursor": "…", "has_more": false }Pass next_cursor back as since. It is always set: when has_more is
false you are caught up, and the same cursor picks up new events next
time. limit is 1 to 1,000, 100 by default.
Errors
Every error has the same shape, with a stable code and a message for
people:
{ "error": { "code": "not_found", "message": "No such story" } }| Status | code | When |
|---|---|---|
400 | invalid_request | A parameter or the body doesn't match the schema. message says which. |
400 | invalid_json | The body isn't valid JSON. |
400 | invalid_cursor | The cursor wasn't one the API gave you. |
401 | missing_api_key | No Authorization: Bearer header. |
401 | invalid_api_key | The key is unknown or revoked. |
401 | app_paused | Your app is paused. |
403 | forbidden | The key belongs to a different app. |
404 | not_found | No such story or app. A closed story answers 404. |
409 | stale_revision | Subscriptions changed since the revision you sent. Read them again. |
410 | cursor_expired | The catch-up cursor is older than 30 days. Reload in full. |
500 | internal | Something went wrong on our side. Retry later. |