A D 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 D library. std.net.curl sends the request. parseJSON reads the envelope, then parses the body string a second time. Pulled on 2026-10-16, Google Search for dlang scored 70.0 for the week of 2026-10-10, down 18.6% from 86.0. d programming scored 11.0, down 67.65% from 34.0. Those two tokens closed 59 points apart. YouTube for dlang scored 47.0, down 20.34% from 59.0. Do not copy bare dlang 70.0 onto a language-adoption alert that only watches the phrase token at 11.0. The same helper that stores those rows also pulls a live Google Trends board; a rank-8 token that weekly Search still printed at 5.0 versus 10.0 is documented in Tesla Roadster live rank versus weekly Search.

How does a D 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":"d programming","percent_growth":["7D","30D","3M","12M"]}
import std.net.curl;
import std.json;
import std.process : environment;

JSONValue postInner(string payload)
{
    auto http = HTTP();
    http.addRequestHeader("Authorization", "Bearer " ~ environment.get("TRENDSAPI_API_KEY", ""));
    http.addRequestHeader("Content-Type", "application/json");
    auto bytes = post("https://api.trendsapi.ai/api", payload, http);
    auto envelope = parseJSON(cast(string) bytes);
    // body is a JSON string; parse it a second time
    return parseJSON(envelope["body"].str);
}
auto inner = postInner(`{
  "mode": "get_growth",
  "source": "google search",
  "keyword": "d programming",
  "percent_growth": ["7D", "30D", "3M", "12M"]
}`);
import std.stdio : writeln;
writeln(inner);

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

https://dlang.org/phobos/std_net_curl.html
https://dlang.org/phobos/std_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 D-specific source on this API. npm covers npmjs package names. python covers PyPI project names. There is no Dub source. A watchlist that needs Dub download counts has to pull those from somewhere else. A Crystal sibling of this helper is on Crystal Trends API. A Nim sibling is on Nim Trends API.

What did get_growth return for D language tokens?

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

Keyword Period Recent date Recent Baseline date Baseline Growth
dlang 7D 2026-10-10 70.0 2026-10-03 86.0 -18.6%
dlang 14D 2026-10-10 70.0 2026-09-26 88.0 -20.45%
dlang 30D 2026-10-10 70.0 2026-09-12 88.0 -20.45%
dlang 3M 2026-10-10 70.0 2026-07-11 87.0 -19.54%
dlang 12M 2026-10-10 70.0 2025-10-11 62.0 +12.9%
dlang YTD 2026-10-10 70.0 2026-01-03 68.0 +2.94%
d programming 7D 2026-10-10 11.0 2026-10-03 34.0 -67.65%
d programming 14D 2026-10-10 11.0 2026-09-26 62.0 -82.26%
d programming 30D 2026-10-10 11.0 2026-09-12 36.0 -69.44%
d programming 3M 2026-10-10 11.0 2026-07-11 49.0 -77.55%
d programming 12M 2026-10-10 11.0 2025-10-11 21.0 -47.62%
d programming YTD 2026-10-10 11.0 2026-01-03 18.0 -38.89%
d language 7D 2026-10-10 16.0 2026-10-03 37.0 -56.76%
d language 14D 2026-10-10 16.0 2026-09-26 63.0 -74.6%
d language 30D 2026-10-10 16.0 2026-09-12 43.0 -62.79%
d language 3M 2026-10-10 16.0 2026-07-11 52.0 -69.23%
d language 12M 2026-10-10 16.0 2025-10-11 30.0 -46.67%
d language YTD 2026-10-10 16.0 2026-01-03 24.0 -33.33%
dub 7D 2026-10-10 67.0 2026-10-03 70.0 -4.29%
dub 14D 2026-10-10 67.0 2026-09-26 100.0 -33.0%
dub 12M 2026-10-10 67.0 2025-10-11 71.0 -5.63%
zig programming 7D 2026-10-10 20.0 2026-10-03 18.0 +11.11%
zig programming 12M 2026-10-10 20.0 2025-10-11 36.0 -44.44%
rust programming 7D 2026-10-10 27.0 2026-10-03 18.0 +50.0%
rust programming 12M 2026-10-10 27.0 2025-10-11 31.0 -12.9%
nim programming 7D 2026-10-10 12.0 2026-10-03 6.0 +100.0%
nim programming 12M 2026-10-10 12.0 2025-10-11 33.0 -63.64%
crystal programming 7D 2026-10-10 4.0 2026-10-03 26.0 -84.62%
go programming 7D 2026-10-10 16.0 2026-10-03 30.0 -46.67%
go programming 12M 2026-10-10 16.0 2025-10-11 48.0 -66.67%

dlang closed at 70.0, down 18.6% from 86.0. d programming closed at 11.0, down 67.65% from 34.0. Same Saturday tip, same 7D sign, 59 points apart. The phrase token fell harder. d language scored 16.0, down 56.76% from 37.0. 3M on that phrase was 16.0 versus 52.0 (-69.23%). 12M was 16.0 versus 30.0 (-46.67%). YTD was 16.0 versus 24.0 (-33.33%). Do not copy the short token 70.0 onto either phrase. 12M on dlang was +12.9% versus 62.0 while 7D was -18.6%. Do not copy the 12M sign onto the 7D drop.

Bare dub scored 67.0, down 4.29% from 70.0. 14D was 67.0 versus 100.0 (-33.0%). 12M was 67.0 versus 71.0 (-5.63%). YTD was 67.0 versus 71.0 (-5.63%). That is the English-word series, not Dub download volume. There is no Dub source. A job that alerts "Dub is down 4.29%" off Search 67.0 is reading a different series.

zig programming scored 20.0, up 11.11% from 18.0. 12M was 20.0 versus 36.0 (-44.44%). YTD was 20.0 versus 36.0 (-44.44%). Yesterday the same Saturday tip printed Zig at 19.0 versus 21.0 (-9.52%). The 2026-10-03 baseline reprinted from 21.0 to 18.0 and flipped the 7D sign again. Store the session pull. rust programming scored 27.0, up 50.0% from 18.0. 12M was 27.0 versus 31.0 (-12.9%). YTD was 27.0 versus 29.0 (-6.9%). nim programming scored 12.0, up 100.0% from 6.0. 12M was 12.0 versus 33.0 (-63.64%). YTD was 12.0 versus 24.0 (-50.0%). Yesterday Nim reprinted 13.0 versus 7.0. crystal programming scored 4.0, down 84.62% from 26.0. Yesterday Crystal reprinted 4.0 versus 25.0. go programming scored 16.0, down 46.67% from 30.0. 12M was 16.0 versus 48.0 (-66.67%). YTD was 16.0 versus 33.0 (-51.52%). Do not copy 27.0, 20.0, 12.0, 4.0, or 16.0 onto d programming 11.0.

get_time_series for dlang on Google Search closed at 70 on 2026-10-10, matching get_growth 70.0. Adjacent weeks: 86 on 2026-10-03, 88 on 2026-09-26, 78 on 2026-09-19, 88 on 2026-09-12, 74 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 2025-03-22. Tip 70 is not that March 2025 peak.

get_time_series for d programming closed at 11 on 2026-10-10, matching get_growth 11.0. Adjacent weeks: 34 on 2026-10-03, 62 on 2026-09-26, 48 on 2026-09-19, 36 on 2026-09-12, 42 on 2026-09-05. Peak in this pull is 100 on 2026-06-20. The phrase token sat at 62 two weeks before the tip, then printed 34 and 11. Same week as the short token's close of 70. A Zig sibling of this helper is on Zig Trends API. A Rust sibling is on Rust Trends API.

What did YouTube, News, and Wikipedia return?

YouTube get_growth for dlang tipped 47.0 on 2026-10-10, down 20.34% from 59.0, a slightly deeper 7D drop than Search -18.6%. 14D was 47.0 versus 45.0 (+4.44%). 30D and 3M baselined at 0.0 and printed growth 999999. Report 47.0 versus 0.0. 12M was 47.0 versus 69.0 (-31.88%). YTD was 47.0 versus 44.0 (+6.82%). YTD signs agree with Search +2.94% in direction. get_time_series closed at 47 on 2026-10-10, matching get_growth. Adjacent weeks: 59 on 2026-10-03, 45 on 2026-09-26, 0 on 2026-09-19, 0 on 2026-09-12, 0 on 2026-09-05. Peak in this pull is 100 on 2026-08-01. On 2025-03-22 Search printed 100 while YouTube printed 92. On 2026-08-01 YouTube printed 100 while Search printed 57. YouTube 47.0 is not Search 70.0. Do not copy the YouTube 7D of -20.34% onto a Search drop of -18.6% as if they were one series.

YouTube for d programming tipped 36.0 on 2026-10-10, down 43.75% from 64.0. Same 7D sign as Search programming -67.65%, smaller drop. 14D was 36.0 versus 86.0 (-58.14%). 30D was 36.0 versus 34.0 (+5.88%). 3M was 36.0 versus 100.0 (-64.0%). 12M was 36.0 versus 38.0 (-5.26%). YTD was 36.0 versus 36.0 (0.0%). YouTube programming 36.0 is not Search programming 11.0 and is not bare YouTube 47.0.

Keyword Google News for dlang printed 0.0 on every window (7D, 14D, 30D, 3M, 12M, YTD). data_quality was low. Absence of News coverage for the short token is a finding. Do not fill those zeros from Search 70.0. Keyword Google News for d programming tipped 3.0 on 2026-10-10 versus 0.0 on every listed baseline, so growth printed 999999. Report 3.0 versus 0.0. get_time_series closed at 3, matching get_growth. Adjacent weeks were 0. Peak in this pull is 100 on 2025-03-29. Tip 3 is not that March 2025 peak. Keyword News and the Google News Top News board are different feeds.

Wikipedia resolved three titles. Keyword D (programming language) resolved with September score 20.3 and 6,890 views versus August 3.0 / 5,750 (score +576.67%, volume +19.83%). 3M volume was 6,890 versus 6,010 in June (+14.64%) with score 20.3 versus 7.0. 12M volume was 6,890 versus 6,993 on 2025-09-01 (-1.47%) while the score went 20.3 versus 21.8 (-6.88%). YTD volume was 6,890 versus 9,074 (-24.07%) with score 20.3 versus 53.3 (-61.91%). 7D collapsed to the same monthly point. Report both score and volume.

Keyword Dlang is a different page. September score 1.7 with 11 views versus August 25.9 / 25 (score -93.44%, volume -56.0%). 12M volume was 11 versus 22 (-50.0%). YTD volume was 11 versus 14 (-21.43%). Keyword D is the letter page. September score 61.8 with 29,468 views versus August 63.5 / 30,054 (score -2.68%, volume -1.95%). 12M volume was 29,468 versus 26,593 (+10.81%). The letter title has more September views than the language page (29,468 versus 6,890). The language page has more views than the Dlang stub (6,890 versus 11). Same short-title split as Crystal and Nim, opposite of Erlang, where the long title held the traffic. Compare Wikipedia on volume. Do not join any of those pages onto Search 70.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-16T10:01:41Z ranked rj mitte 1 and tesla roadster 8. The 1-day rank_change sort (25 rows, baseline 2026-10-15T02:01:36Z) omitted tesla roadster. The name was absent from the 2026-10-15T10:01:38Z top 25, so it is new to the live board with no mover row. The 7-day sort returned 0 rows (baseline 2026-10-09T02:01:42Z) with a note that everything held or fell. Weekly Search for tesla roadster was 5.0 versus 10.0 on 7D. Live rank 8 with no 1d mover is not weekly Search 5.0 versus 10.0. The walk-through is Tesla Roadster live rank versus weekly Search.

A D watchlist that stores five Search tokens (dlang, d programming, d 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. dlang, d programming, and d language are three series. dub 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 D library is required. A 20-line std.net.curl helper covers growth, series, and board pulls for jobs that already run under systemd or a cron timer.