Developers · API v1.0
Trends data,as JSON.
Every number on this site comes from these endpoints. Free, keyless and read-only, with CORS open for GET. Machine-readable spec: /openapi.json.
Envelope
Every GET returns the same envelope. Older fields stay at the top level so existing clients keep working; new clients should read data.
| ok | boolean | true on success, false on error |
| version | string | API version, currently "1.0". On /api/radar the scoring model version is in model_version. |
| generated_at | string (ISO 8601 UTC) | when this response was generated |
| data | object | null | the full payload. The same fields are also repeated at the top level for backward compatibility. |
| error | string | human-readable error message (errors only) |
| error_code | string | unsupported_geo, bad_phase, missing_term, method_not_allowed, warming_up, upstream_unavailable (errors only) |
Errors, caching and limits
- Errors use HTTP 400 (bad parameter), 405 (wrong method) or 503 (warming up, or a source failed), with
ok:false,erroranderror_code. - Responses are cached at the edge (see each endpoint). Data refreshes about every 30 minutes, so polling more than every 5 minutes returns the same data.
- CORS:
Access-Control-Allow-Origin: *on GET and OPTIONS. - Times are ISO 8601 in UTC; history arrays use epoch milliseconds.
- Fields are only ever added, never renamed or removed, within API version 1.x.
- Please credit “NYPTID Trends” with a link to trends.nyptid.com. Trend data originates from Google Trends' public feed; we are not affiliated with Google.
/api/trends
Trending searches for one country and phase. Cache: 5 min CDN, 10 min stale-while-revalidate.
curl "https://trends.nyptid.com/api/trends?list=geos"
Parameters
| geo | ISO 3166-1 alpha-2 country code, default US. 125 supported: see ?list=geos |
| phase | now (default) | before | after |
| list | geos: returns the list of supported countries instead |
Fields
| geo, phase | echo of the request |
| updated | last snapshot time (ISO) |
| historySince, snapshots | when we started recording this country and how many snapshots exist |
| items[] | trends, sorted by volume (now), start time (before) or last seen (after) |
| items[].key | normalized term key, use it with /api/sources |
| items[].title, traffic, trafficNum | term and approximate searches ("2000+" and 2000) |
| items[].peakTraffic, peakNum, peakAt | highest volume we recorded and when |
| items[].share | volume relative to the country's top term (0 to 1) |
| items[].started, firstSeen, lastSeen | feed start time and our first/last sighting |
| items[].history | [[epoch_ms, searches], ...] one point per snapshot |
| items[].news[] | {title, url, source} headlines from the Google Trends feed |
| items[].sources | cross-source summary: sources, articles, platforms{}, coverage{last6h, prev24h, accel}, wiki, social{platform: results}, youtubeTrending{videos, countries} |
| items[].signal | before phase only: why it is an early signal |
| youtubeTrending | {available, fetchedAt, stale, note, items[{id, title, channel, url, views, likes, comments, publishedAt, thumbnail}]}: YouTube's most-popular chart for the country (when configured) |
/api/radar
Trend Radar: scored candidates, calls ledger, control picks and record. Cache: 5 min CDN.
Parameters
| No parameters. |
Fields
| model_version | scoring model, e.g. "radar-1.2 (...)" |
| cycles, since, geosTracked, termsLive, noSignal, warming | model state; warming is true below 6 snapshots |
| weights | feature weights, sum 1 |
| candidates[] | {k, term, score 0-100, confidence low|medium|high, measured 0-1, features{name: 0-1}, unknown[], why[], geos[], maxLabel, firstSeen, observations, news} |
| calls[], model_calls[], control_picks[] | {id, model, term, made_at, score, confidence, geos, why, group model|control, status pending|hit|miss, graded_at, outcome} |
| record | {model:{calls, hit, miss, pending, hitRate}, control:{...}} |
| ledger | same as record (legacy name) |
| health | source status, same as /api/sources?health=1 |
/api/search
Search every country, every phase and the last 7 days of history. Cache: 2 min CDN.
Parameters
| q | search text, 2-120 characters, accent and case insensitive |
| limit | 1-200, default 60 |
Fields
| q, total | query and number of matches |
| results[] | {key, title, geo, geoName, phase before|now|after, live, traffic, trafficNum, peakTraffic, started, firstSeen, lastSeen, news[], sources, rel} |
| results[].rel | match strength: 4 exact, 3 prefix, 2 substring, 1 all words, 0.5 headline only |
/api/sources
Every source we have for one term, or the health of every source. Cache: 5 min CDN (health 2 min).
curl "https://trends.nyptid.com/api/sources?health=1"
Parameters
| term | the trend text or its key |
| health | 1: return live status of every source instead |
Fields
| found | false if we have no lookups for this term yet |
| summary | counts, as on trend items |
| outlets | {platform: [outlet names]} |
| groups | {platform: {outlet: [{title, url, at, geo, author, engagement, views}]}} |
| wiki | Wikipedia article daily pageviews and spike ratio |
| gdelt | [[hour_ms, articles]] GDELT volume, 3 days |
| social, socialTimeline, socialVelocity | Social Fetch per-platform results, history and pace |
| timeline | [[ms, articles, outlets]] per snapshot |
| health | {source: {ok true|false|null, note, error}}. socialFetch also has state (live, "paused: daily cap", "paused: low balance"), cap, usedToday, balance and platforms{} |
/api/evergreen
Terms that persist across many snapshots, days and countries. Cache: 10 min CDN.
Parameters
| No parameters. |
Fields
| criteria | the exact rules used |
| historyDays, enoughHistory, note | honest status while history is shorter than 7 days |
| evergreen[] | {key, title, firstSeen, lastSeen, spanDays, daysSeen, snapshotsSeen, countriesEver, maxCountriesAtOnce, liveNow, countries[]} |
| emerging[] | same shape: terms seen on 2+ days in 2+ countries |
| termsTracked | how many terms are in history |
/api/donate
Support checkout configuration (POST creates a Stripe Checkout Session from the browser). Cache: no-store.
Parameters
| No parameters. |
Fields
| enabled | whether checkout is available |
| min, max, currency, presets | allowed amounts in USD |