A TypeScript job talks to Trends API with one POST to https://api.trendsapi.ai/api, a Bearer key, and a JSON body that names a mode. There is no official TypeScript library. fetch sends the request. JSON.parse reads the envelope, then parses the body string a second time. Pulled on 2026-09-17, Google Search for typescript scored 25.0 for the week of 2026-09-12, down 35.9% from 39.0. typescript programming scored 15.0, down 31.82% from 22.0. javascript scored 26.0, down 23.53% from 34.0. The npm source for package typescript printed 202,104,337 weekly downloads at score 73.5. Do not copy Search 25.0 onto that download count. The same helper that stores those rows also pulls a live Google Trends board; a rank-1 how-to phrase that weekly Search still printed at 0.0 is documented in how do i register to vote live rank versus weekly Search.
How does a TypeScript client call Trends API?
POST https://api.trendsapi.ai/api
Authorization: Bearer <api_key>
Content-Type: application/json
{"mode":"get_growth","source":"google search","keyword":"typescript","percent_growth":["7D","30D","3M","12M"]}
type Envelope = { statusCode: number; body: string };
async function trendsPost(payload: unknown): Promise<unknown> {
const key = process.env.TRENDSAPI_API_KEY;
if (!key) {
throw new Error("TRENDSAPI_API_KEY is unset");
}
const res = await fetch("https://api.trendsapi.ai/api", {
method: "POST",
headers: {
Authorization: `Bearer ${key}`,
"Content-Type": "application/json",
},
body: JSON.stringify(payload),
});
if (!res.ok) {
throw new Error(`HTTP ${res.status}`);
}
const envelope = (await res.json()) as Envelope;
// body is a JSON string; parse it a second time
return JSON.parse(envelope.body);
}
const inner = await trendsPost({
mode: "get_growth",
source: "google search",
keyword: "typescript",
percent_growth: ["7D", "30D", "3M", "12M"],
});
console.log(inner);
The first mistake most clients make is treating the body field as an object after one parse. It is still a JSON string. fetch decodes the envelope. JSON.parse then reads body a second time. Type the envelope as { statusCode: number; body: string } so the compiler rejects a one-parse path. Library docs:
https://www.typescriptlang.org/docs/handbook/2/everyday-types.html
https://developer.mozilla.org/docs/Web/API/Fetch_API
Free tier allows 100 successful requests per month. Only HTTP 200 responses count against quota. Starter is 5,000, Pro is 25,000, Business is 100,000. There is no TypeScript-specific source on this API. npm covers npmjs package names (typescript, tsx, ts-node). python covers PyPI project names. A TypeScript watchlist that needs compiler download counts uses source npm with the exact package string.
The untyped Node sibling of this helper is Node.js Trends API.
What did get_growth return for TypeScript language tokens?
Pulled on 2026-09-17 with source set to google search. get_growth tips on 2026-09-12. The prior Saturday 2026-09-05 is the last full week in the same series. Bare bun is a polluted token (the food, the runtime, other homonyms). Store bun.js for the runtime. Bare deno sits above the language token and is a separate string.
| Keyword | Period | Recent | Baseline date | Baseline | Growth |
|---|---|---|---|---|---|
| typescript | 7D | 25.0 | 2026-09-05 | 39.0 | -35.9% |
| typescript | 14D | 25.0 | 2026-08-29 | 36.0 | -30.56% |
| typescript | 30D | 25.0 | 2026-08-15 | 38.0 | -34.21% |
| typescript | 3M | 25.0 | 2026-06-13 | 88.0 | -71.59% |
| typescript | 12M | 25.0 | 2025-09-13 | 48.0 | -47.92% |
| typescript | YTD | 25.0 | 2026-01-03 | 24.0 | +4.17% |
| typescript programming | 7D | 15.0 | 2026-09-05 | 22.0 | -31.82% |
| typescript language | 7D | 13.0 | 2026-09-05 | 25.0 | -48.0% |
| javascript | 7D | 26.0 | 2026-09-05 | 34.0 | -23.53% |
| node.js | 7D | 25.0 | 2026-09-05 | 34.0 | -26.47% |
| deno | 7D | 41.0 | 2026-09-05 | 42.0 | -2.38% |
| bun | 7D | 67.0 | 2026-09-05 | 73.0 | -8.22% |
| bun.js | 7D | 5.0 | 2026-09-05 | 2.0 | +150.0% |
| dart programming | 7D | 27.0 | 2026-09-05 | 31.0 | -12.9% |
| rust programming | 7D | 14.0 | 2026-09-05 | 18.0 | -22.22% |
typescript and javascript closed in the same 7D direction. The compiler token fell 35.9% to 25.0. javascript fell 23.53% to 26.0. typescript programming scored 15.0, down 31.82% from 22.0. typescript language scored 13.0, down 48.0% from 25.0. node.js scored 25.0, down 26.47% from 34.0. Bare deno scored 41.0. Bare bun scored 67.0. bun.js scored 5.0, up 150.0% from 2.0. Matching week dates do not make those strings one series. A job that alerts "TypeScript is up" off bun.js 7D +150.0% is reading a 5.0 runtime token. Store each string.
3M is a summer drop on the language tokens, milder on YTD for the short compiler string. typescript is 25.0 versus 88.0 on 2026-06-13 (-71.59%). typescript programming is 15.0 versus 85.0 (-82.35%). typescript language is 13.0 versus 84.0 (-84.52%). javascript is 26.0 versus 72.0 (-63.89%). node.js is 25.0 versus 78.0 (-67.95%). deno is 41.0 versus 70.0 (-41.43%). bun.js is 5.0 versus 18.0 (-72.22%). dart programming is 27.0 versus 68.0 (-60.29%). rust programming is 14.0 versus 39.0 (-64.1%). Do not alert language adoption off a bun.js 3M crash or a deno 41.0 score. YouTube for the same tokens is a different shape (next section).
get_time_series for typescript on Google Search closed at 25 on 2026-09-12, matching get_growth 25.0. Adjacent weeks: 39 on 2026-09-05, 36 on 2026-08-29, 31 on 2026-08-22, 38 on 2026-08-15, 44 on 2026-08-08. The series hit 100 on 2026-05-16, with 97 on 2026-06-06, 94 on 2026-05-30, and 88 on 2026-06-13. The 2026-01-03 close was 24. The 2025-09-13 close was 48. The 7D drop from 39 to 25 sits after that May peak, not at a new high. YTD +4.17% is 25.0 versus 24.0. That is a January floor bounce, not a 3M recovery.
javascript YTD was 26.0 versus 22.0 on 2026-01-03 (+18.18%) while typescript YTD was only +4.17%. node.js YTD was 25.0 versus 17.0 (+47.06%). Do not copy javascript YTD +18.18% onto typescript. bun.js 14D, 30D, 12M, and YTD baselined at 0.0 and printed growth 999999. Report 5.0 versus 0.0. Do not store 999999.
The Dart sibling of this helper is Dart Trends API. The Elixir sibling is Elixir Trends API.
What did npm, YouTube, News, and Wikipedia return?
Compare npm packages on recent_volume, not on the 0-100 score. Pulled on 2026-09-17 with source set to npm.
| Package | Period | Score | Volume | Baseline date | Baseline volume | Volume growth |
|---|---|---|---|---|---|---|
| typescript | 7D | 73.5 | 202,104,337 | 2026-09-05 | 241,986,807 | -16.48% |
| typescript | 14D | 73.5 | 202,104,337 | 2026-08-29 | 273,429,217 | -26.09% |
| typescript | 30D | 73.5 | 202,104,337 | 2026-08-15 | 180,404,383 | +12.03% |
| typescript | 3M | 73.5 | 202,104,337 | 2026-06-13 | 217,272,103 | -6.98% |
| typescript | 12M | 73.5 | 202,104,337 | 2025-09-13 | 93,410,854 | +116.36% |
| typescript | YTD | 73.5 | 202,104,337 | 2026-01-03 | 59,390,825 | +240.3% |
| tsx | 7D | 74.3 | 64,117,494 | 2026-09-05 | 61,104,921 | +4.93% |
| ts-node | 7D | 46.2 | 34,146,875 | 2026-09-05 | 41,938,739 | -18.58% |
tsx scored 74.3 next to typescript 73.5. Volumes are 64,117,494 versus 202,104,337. A job that ranks runners by 0-100 score puts tsx above the compiler. Rank by recent_volume. tsx 7D volume rose 4.93% while typescript volume fell 16.48% and ts-node volume fell 18.58%. Do not alert compiler adoption off a tsx 7D bounce or a ts-node 7D drop. tsx 12M volume was 64,117,494 versus 12,465,557 (+414.36%). ts-node 12M volume was 34,146,875 versus 31,496,295 (+8.42%). Those are three packages.
get_time_series for npm typescript closed at 73.5 / 202,104,337 on 2026-09-12, matching get_growth. Adjacent weeks: 88.3 / 241,986,807 on 2026-09-05, 100.0 / 273,429,217 on 2026-08-29, 98.5 / 269,286,177 on 2026-08-22. Peak in this pull is 100.0 / 273,429,217 on 2026-08-29. The 2026-01-03 close was 20.4 / 59,390,825. The 2025-09-13 close was 33.0 / 93,410,854. Search 25.0 and npm 73.5 are not one series. Search fell 35.9% on 7D while npm volume fell 16.48%. Do not copy Search 25.0 onto 202,104,337 downloads.
YouTube for typescript tipped 54.0 on 2026-09-12, up 3.85% from 52.0 on 2026-09-05, the opposite 7D direction from Search -35.9%. 14D was 54.0 versus 55.0 (-1.82%). 30D was 54.0 versus 59.0 (-8.47%). 3M was 54.0 versus 58.0 (-6.9%). 12M was 54.0 versus 52.0 (+3.85%). YTD was 54.0 versus 45.0 (+20.0%). YouTube 54.0 is not Search 25.0. A Search summer crash is not a YouTube 7D bounce of the same size.
YouTube for typescript programming moved opposite Search on 7D. It tipped 27.0, up 200.0% from 9.0, while Search fell 31.82%. 14D, 30D, 3M, 12M, and YTD baselined at 0.0 and printed growth 999999. The payload marked data_quality low with a warning that the underlying signal is over 90% zeros. Report 27.0 versus 0.0. Do not store 999999. Phrase YouTube 27.0 is not phrase Search 15.0.
YouTube for javascript tipped 43.0, down 2.27% from 44.0, while Search fell 23.53%. 30D was 43.0 versus 67.0 (-35.82%). Do not copy YouTube 43.0 onto Search 26.0.
Keyword Google News for typescript tipped 16.0 on 2026-09-12, down 84.0% from 100.0 on 2026-09-05, while Search fell 35.9%. 14D was 16.0 versus 92.0 (-82.61%). 30D was 16.0 versus 54.0 (-70.37%). 3M was 16.0 versus 6.0 (+166.67%). 12M and YTD baselined at 0.0 and printed growth 999999. Report 16.0 versus 0.0 for those long windows. Keyword News 16.0 after a 100.0 prior week is not Search 25.0. Keyword News and the Google News Top News board are different feeds. Do not fill News from Search 25.0.
Wikipedia resolved two titles. Keyword TypeScript resolved as Typescript with August score 7.2 and 412 views versus July 5.1 / 387 (score +41.18%, volume +6.46%). 3M volume was 412 versus 389 on 2026-05-01 (+5.91%). 12M volume was 412 versus 644 on 2025-08-01 (-36.02%) while the score went 7.2 versus 26.1 (-72.41%). YTD volume was 412 versus 477 (-13.63%) with score 7.2 versus 12.5 (-42.4%). 7D and 14D collapsed to the same monthly point.
Keyword JavaScript resolved as Javascript with August score 9.1 and 1,455 views versus July 15.1 / 1,802 (score -39.74%, volume -19.26%). 12M volume was 1,455 versus 2,026 (-28.18%). YTD volume was 1,455 versus 1,316 (+10.56%) with score 9.1 versus 6.6 (+37.88%). The JavaScript title has more August views than TypeScript (1,455 versus 412). Compare Wikipedia on volume. Do not join either page onto Search 25.0. Notes for the Wikipedia source sit on Wikipedia Trends.
How does a watchlist store live boards next to weekly scores?
get_top_trends has no keyword. It returns a ranked board. Pair it with get_growth for the tokens that appear, using the exact board string.
{"mode":"get_top_trends","type":"Google Trends","limit":25}
{"mode":"get_top_trends","type":"Google Trends","sort":"rank_change","window":"1d","limit":25}
The Google Trends board at 2026-09-17T10:01:33Z ranked how do i register to vote 1. The 1-day rank_change sort returned 25 rows (baseline 2026-09-16T02:01:36Z) and omitted that token. The 7-day sort returned 5 rows (baseline 2026-09-10T02:01:40Z) and omitted it. Weekly Search for the same phrase was 0.0 on every listed window, with data_quality low. Live rank 1 can sit next to weekly Search at the floor. The walk-through is how do i register to vote live rank versus weekly Search.
A TypeScript watchlist that stores six Search tokens (typescript, typescript programming, javascript, node.js, bun.js, dart programming) plus one Google Trends board uses 7 successful 200s. Four runs per 30-day month is 28 calls and fits the free cap of 100. Daily polling of that set is about 210 calls and needs Starter (5,000). Modes and sources for the modes live at https://trendsapi.ai/docs. Google Search board strings are not always valid get_growth keywords. Pair get_top_trends rank, rank_change, and get_growth before writing an alert. Source notes for Search sit on Google Trends.
The Python sibling of this helper is Python Trends API.
Envelope checklist
POST https://api.trendsapi.ai/apiwithAuthorization: Bearer <api_key>.- Modes are
get_time_series,get_growth, andget_top_trendsonly. - Parse
bodytwice before readingresultsor dated points. Type the envelope sobodystays a string until the second parse. - Google Search uses the exact token typed.
typescript,typescript programming,typescript language,javascript,node.js,deno,bun, andbun.jsare eight series. npm packages are exact npmjs names; compare onrecent_volume. Wikipedia titles are resolved names; confirm the title and compare on volume before joining. - Quota counts successful 200 responses: free 100/month, then 5,000 / 25,000 / 100,000 on paid tiers.
No TypeScript library is required. A 40-line typed fetch helper covers growth, series, and board pulls for jobs that already run under systemd or a cron timer.