A Nim 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 Nim library. std/httpclient sends the request. std/json parses the envelope, then parses the body string a second time. Pulled on 2026-10-14, Google Search for nim scored 82.0 for the week of 2026-10-10, down 4.65% from 86.0. nim programming scored 14.0, up 40.0% from 10.0. Those two tokens closed 68 points apart and moved in opposite 7D directions. YouTube for nim scored 10.0, down 9.09% from 11.0. Do not copy bare nim 82.0 onto a language-adoption alert that only watches the 7D bounce on the phrase token. The same helper that stores those rows also pulls a live Google Trends board; a rank-20 token that weekly Search still printed at 2.0 versus 3.0 is documented in Pope Leo live rank versus weekly Search.

How does a Nim 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":"nim programming","percent_growth":["7D","30D","3M","12M"]}
import std/httpclient
import std/json
import std/os

proc post(payload: JsonNode): JsonNode =
  let key = getEnv("TRENDSAPI_API_KEY")
  let client = newHttpClient()
  client.headers = newHttpHeaders({
    "Authorization": "Bearer " & key,
    "Content-Type": "application/json"
  })
  let resp = client.postContent("https://api.trendsapi.ai/api", $payload)
  client.close()
  let envelope = parseJson(resp)
  # body is a JSON string; parse it a second time
  parseJson(envelope["body"].getStr())
let inner = post(%*{
  "mode": "get_growth",
  "source": "google search",
  "keyword": "nim programming",
  "percent_growth": ["7D", "30D", "3M", "12M"]
})
echo inner

The first mistake most clients make is treating the body field as an object after one parse. It is still a JSON string. httpclient returns the envelope bytes. parseJson then parses body a second time. Library docs:

https://nim-lang.org/docs/httpclient.html
https://nim-lang.org/docs/json.html

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 Nim-specific source on this API. npm covers npmjs package names. python covers PyPI project names. There is no Nimble source. A watchlist that needs Nimble download counts has to pull those from somewhere else. A Zig sibling of this helper is on Zig Trends API. An Erlang sibling is on Erlang Trends API.

What did get_growth return for Nim language tokens?

get_growth for nim on google search tips on 2026-10-10. Store the exact strings. The short token, the programming phrase, and the nim language phrase are different series. Bare nimble is not the package manager.

Keyword Period Recent date Recent Baseline date Baseline Growth
nim 7D 2026-10-10 82.0 2026-10-03 86.0 -4.65%
nim 14D 2026-10-10 82.0 2026-09-26 96.0 -14.58%
nim 30D 2026-10-10 82.0 2026-09-12 95.0 -13.68%
nim 3M 2026-10-10 82.0 2026-07-11 90.0 -8.89%
nim 12M 2026-10-10 82.0 2025-10-11 68.0 +20.59%
nim YTD 2026-10-10 82.0 2026-01-03 68.0 +20.59%
nim programming 7D 2026-10-10 14.0 2026-10-03 10.0 +40.0%
nim programming 14D 2026-10-10 14.0 2026-09-26 57.0 -75.44%
nim programming 30D 2026-10-10 14.0 2026-09-12 0.0 14.0 vs 0.0
nim programming 3M 2026-10-10 14.0 2026-07-11 53.0 -73.58%
nim programming 12M 2026-10-10 14.0 2025-10-11 39.0 -64.1%
nim programming YTD 2026-10-10 14.0 2026-01-03 0.0 14.0 vs 0.0
nim language 7D 2026-10-10 12.0 2026-10-03 7.0 +71.43%
nim language 14D 2026-10-10 12.0 2026-09-26 54.0 -77.78%
nim language 30D 2026-10-10 12.0 2026-09-12 36.0 -66.67%
nim language 3M 2026-10-10 12.0 2026-07-11 63.0 -80.95%
nim language 12M 2026-10-10 12.0 2025-10-11 34.0 -64.71%
nim language YTD 2026-10-10 12.0 2026-01-03 30.0 -60.0%
nimble 7D 2026-10-10 58.0 2026-10-03 66.0 -12.12%
nimble 12M 2026-10-10 58.0 2025-10-11 66.0 -12.12%
nimble YTD 2026-10-10 58.0 2026-01-03 58.0 0.0%
zig programming 7D 2026-10-10 19.0 2026-10-03 9.0 +111.11%
zig programming 12M 2026-10-10 19.0 2025-10-11 35.0 -45.71%
zig 7D 2026-10-10 66.0 2026-10-03 67.0 -1.49%
rust programming 7D 2026-10-10 26.0 2026-10-03 18.0 +44.44%
rust programming 12M 2026-10-10 26.0 2025-10-11 32.0 -18.75%
go programming 7D 2026-10-10 16.0 2026-10-03 29.0 -44.83%
c programming 7D 2026-10-10 43.0 2026-10-03 49.0 -12.24%

nim closed at 82.0, down 4.65% from 86.0. nim programming closed at 14.0, up 40.0% from 10.0. Same Saturday tip, opposite 7D signs, 68 points apart. 30D and YTD on the phrase token baselined at 0.0 and printed growth 999999. Report 14.0 versus 0.0. Do not store 999999. nim language scored 12.0, up 71.43% from 7.0. 3M on that phrase was 12.0 versus 63.0 (-80.95%). 12M was 12.0 versus 34.0 (-64.71%). YTD was 12.0 versus 30.0 (-60.0%). Do not copy the 7D bounce of +71.43% onto a 12M drop to 12.0.

Bare nimble scored 58.0, down 12.12% from 66.0. YTD was 58.0 versus 58.0. That is the English-adjective series, not Nimble download volume. There is no Nimble source. A job that alerts "Nimble is down 12.12%" off Search 58.0 is reading a different series.

Bare zig scored 66.0, down 1.49% from 67.0, while zig programming scored 19.0, up 111.11% from 9.0. 12M on the Zig phrase was 19.0 versus 35.0 (-45.71%). YTD was 19.0 versus 38.0 (-50.0%). rust programming scored 26.0, up 44.44% from 18.0. 12M was 26.0 versus 32.0 (-18.75%). YTD was 26.0 versus 29.0 (-10.34%). Yesterday the same Saturday tip reprinted Rust at 25.0 versus 16.0. Store the session pull. go programming scored 16.0, down 44.83% from 29.0. 12M was 16.0 versus 49.0 (-67.35%). YTD was 16.0 versus 33.0 (-51.52%). Yesterday Go reprinted 16.0 versus 27.0. c programming scored 43.0, down 12.24% from 49.0. 12M was 43.0 versus 63.0 (-31.75%). YTD was 43.0 versus 45.0 (-4.44%). Do not copy 26.0, 19.0, 16.0, or 43.0 onto nim programming 14.0.

get_time_series for nim on Google Search closed at 82 on 2026-10-10, matching get_growth 82.0. Adjacent weeks: 86 on 2026-10-03, 96 on 2026-09-26, 99 on 2026-09-19, 95 on 2026-09-12, 96 on 2026-09-05. The series has 261 weekly points from 2021-10-16 through 2026-10-10. Peak in this pull is 100 on 2026-05-16, again on 2026-05-30, and again on 2026-06-06. Tip 82 is not that May and June 2026 peak.

get_time_series for nim programming closed at 14 on 2026-10-10, matching get_growth 14.0. Adjacent weeks: 10 on 2026-10-03, 57 on 2026-09-26, 45 on 2026-09-19, 0 on 2026-09-12, 32 on 2026-09-05. Peak in this pull is 100 on 2026-06-13. The phrase token sat at 0 on 2026-09-12, then printed 45, 57, 10, and 14. Same week as the short token's close of 82. Opposite 7D sign. A Rust sibling of this helper is on Rust Trends API. A Go sibling is on Go Trends API.

What did YouTube, News, and Wikipedia return?

YouTube get_growth for nim tipped 10.0 on 2026-10-10, down 9.09% from 11.0, a slightly steeper 7D drop than Search -4.65%. 14D was 10.0 versus 11.0 (-9.09%). 30D was 10.0 versus 12.0 (-16.67%). 3M was 10.0 versus 10.0 (0.0%). 12M was 10.0 versus 9.0 (+11.11%). YTD was 10.0 versus 9.0 (+11.11%). YTD signs agree with Search +20.59% in direction and disagree in size. get_time_series closed at 10 on 2026-10-10, matching get_growth. Adjacent weeks: 11 on 2026-10-03, 11 on 2026-09-26, 11 on 2026-09-19, 12 on 2026-09-12. Peak in this pull is 100 on 2023-12-23. On 2026-05-16 Search printed 100 while YouTube printed 9. YouTube 10.0 is not Search 82.0. Do not copy the YouTube YTD bounce onto a Search 7D drop.

YouTube for nim programming tipped 13.0 on 2026-10-10, up 44.44% from 9.0. 14D, 30D, 3M, 12M, and YTD baselined at 0.0 and printed growth 999999. Report 13.0 versus 0.0. data_quality was low. YouTube programming 13.0 is not Search programming 14.0 and is not bare YouTube 10.0.

Keyword Google News for nim tipped 20.0 on 2026-10-10, up 150.0% from 8.0. 14D was 20.0 versus 28.0 (-28.57%). 30D, 3M, 12M, and YTD baselined at 0.0. Report 20.0 versus 0.0 on those windows. get_time_series closed at 20, matching get_growth. Adjacent weeks: 8 on 2026-10-03, 28 on 2026-09-26, 0 on 2026-09-19, 0 on 2026-09-12, 53 on 2026-09-05. Peak in this pull is 100 on 2026-08-15, with 98 on 2026-08-22. Tip 20 is not a new News high. News 7D +150.0% does not lead Search 7D -4.65%. Keyword News and the Google News Top News board are different feeds. Do not fill News from Search 82.0.

Wikipedia resolved two titles. Keyword Nim (programming language) resolved with September score 1.5 and 3,676 views versus June 10.6 / 4,186 (score -85.85%, volume -12.18%). 30D volume was 3,676 versus 4,146 on 2026-08-01 (-11.34%) with score 1.5 versus 9.9. 12M volume was 3,676 versus 4,160 on 2025-09-01 (-11.63%) while the score went 1.5 versus 10.2 (-85.29%). YTD volume was 3,676 versus 4,278 (-14.07%) with score 1.5 versus 12.3 (-87.8%). 7D collapsed to the same monthly point. Report both score and volume.

Keyword Nim is a different page. September score 0.2 with 8,179 views versus June 9.1 / 9,037 (score -97.8%, volume -9.49%). 30D volume was 8,179 versus 8,160 (+0.23%) with score 0.2 versus 0.0. 12M volume was 8,179 versus 11,844 (-30.94%). YTD volume was 8,179 versus 8,927 (-8.38%). The short title has more September views than the language page (8,179 versus 3,676). Opposite of the Erlang split, where the long title held the traffic. Compare Wikipedia on volume. Do not join either page onto Search 82.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-10-14T08:01:40Z ranked rj mitte 1 and pope leo 20. The 1-day rank_change sort (25 rows, baseline 2026-10-13T02:01:46Z) listed pope leo at rank 20 with rank_change +125 from prev_rank 145. The 7-day sort returned 0 rows (baseline 2026-10-07T02:01:38Z) with a note that every item held or fell. Weekly Search for pope leo was 2.0 versus 3.0 on 7D (-33.33%). Live rank 20 with 1d +125 is not weekly Search 2.0 falling. The walk-through is Pope Leo live rank versus weekly Search.

A Nim watchlist that stores five Search tokens (nim, nim programming, nim language, zig programming, rust programming) plus one YouTube series 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.

Envelope checklist

  1. POST https://api.trendsapi.ai/api with Authorization: Bearer <api_key>.
  2. Modes are get_time_series, get_growth, and get_top_trends only.
  3. Parse body twice before reading results or dated points.
  4. Google Search uses the exact token typed. nim, nim programming, and nim language are three series. nimble without a language qualifier is another series. Wikipedia titles are resolved names; confirm the title and compare on volume before joining.
  5. Quota counts successful 200 responses: free 100/month, then 5,000 / 25,000 / 100,000 on paid tiers.

No Nim library is required. A 20-line httpclient helper covers growth, series, and board pulls for jobs that already run under systemd or a cron timer.