A MoonBit 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 MoonBit library. moonbitlang/async @http.post sends the request. @json.parse reads JSON. The first decode reads the envelope, then a second decode reads the body string. Pulled on 2026-11-15, Google Search for moonbit scored 19.0 for the week of 2026-11-14, versus 18.0, up 5.56%. moonbit programming scored 0.0 versus 0.0. moonbit language scored 5.0 versus 5.0. YouTube for moonbit scored 40.0 versus 12.0, up 233.33%. Do not copy moonbit 19.0 onto a MoonBit adoption alert that only watches the phrase token at 0.0. Neighbors in the same session still sat on 2026-11-07, so do not join php 25.0 onto moonbit 19.0 as the same week.

How does a MoonBit client POST get_growth?

The documented HTTP helpers live in moonbitlang/async. @http.post takes a URL, a body that implements @io.Data, and an optional header map. @env.get_env_var reads the key. @json.parse turns a string into Json. stringify turns a Json value back into bytes for the POST.

POST https://api.trendsapi.ai/api
Authorization: Bearer <api_key>
Content-Type: application/json

{"mode":"get_growth","source":"google search","keyword":"moonbit","percent_growth":["7D","30D","3M","12M"]}
///|
struct Envelope {
  statusCode : Int
  body : String
} derive(@json.FromJson)

///|
async fn main {
  let api_key = match @env.get_env_var("TRENDSAPI_API_KEY") {
    Some(value) => value
    None => {
      println("set TRENDSAPI_API_KEY")
      return
    }
  }
  let payload : Json = {
    "mode": "get_growth",
    "source": "google search",
    "keyword": "moonbit",
    "percent_growth": ["7D", "30D", "3M", "12M"],
  }
  let (response, body) = @http.post(
    "https://api.trendsapi.ai/api",
    payload.stringify(),
    headers={
      "Authorization": "Bearer \{api_key}",
      "Content-Type": "application/json",
    },
  )
  guard response.code is 200 else {
    fail("HTTP \{response.code}")
  }
  let envelope : Envelope = body.json() |> @json.from_json()
  let inner = @json.parse(envelope.body)
  println(inner.stringify(indent=2))
}

Package names and docs belong next to the code, not in prose as live links:

https://mooncakes.io/docs/moonbitlang/async/http
https://mooncakes.io/docs/moonbitlang/core/json
https://mooncakes.io/docs/moonbitlang/core/env
https://www.moonbitlang.com/blog/moonbit-async-code-agent

Every successful response is {"statusCode": int, "body": string}. body.json() is the first parse. envelope.body is still a string. @json.parse on that string is the second parse. Skipping it leaves recent_value unreachable. Docs for the envelope sit at https://trendsapi.ai/docs. Google Search series docs sit at https://trendsapi.ai/trends/google-trends.

What did moonbit Search print against the phrase tokens?

Bare moonbit Search closed at 19.0 versus 18.0 on the 2026-11-14 tip, matching the series close of 19.0. Adjacent weeks were 18.0, then 0.0, then 0.0, then 24.0. 14D compared 19.0 versus 0.0 and printed growth 999999.0 because the 2026-10-31 baseline was a zero floor. 30D was 19.0 versus 24.0, down 20.83%. 3M was 19.0 versus 32.0, down 40.62%. 12M was 19.0 versus 25.0, down 24.0%. YTD was 19.0 versus 31.0, down 38.71%. Peak was 100.0 on 2026-07-11, then 65.0 on 2025-12-27, 64.0 on 2026-02-28, 58.0 on 2024-12-28, and 57.0 on 2026-05-16 and 2026-05-23. Tip 19.0 is not a new high.

moonbit programming Search closed at 0.0 versus 0.0 on every requested window, with data_quality low. The series is not empty in history. Peak was 100.0 on 2026-07-04, then 90.0 on 2026-07-18, 82.0 on 2024-03-23, and 81.0 on 2024-08-10. On 2026-07-11, the week bare moonbit printed 100.0, the phrase printed 0.0. A helper that only stores 7D then reports 0.0 and misses the July 100.0.

moonbit language Search closed at 5.0 versus 5.0, matching the series close of 5.0, with data_quality low. Adjacent weeks were 5.0, then 0.0, then 0.0, then 0.0. 14D, 30D, 3M, 12M, and YTD each compared 5.0 versus 0.0 and printed growth 999999.0. Peak was 100.0 on 2026-05-09, then 73.0 on 2024-02-03, 69.0 on 2026-05-16, and 67.0 on 2026-07-11. On 2026-07-11 language printed 67.0 while programming printed 0.0 and bare printed 100.0. Opposite weeks are not matching series.

moonbitlang Search closed at 0.0 versus 0.0 on every window, data_quality low. moonbit compiler Search closed at 0.0 versus 0.0 on every window, data_quality low. mooncakes Search closed at 4.0 versus 4.0, volume 30700, on the same 2026-11-14 tip. 14D was 4.0 versus 5.0, down 20.0%, volume 30700 versus 38300. 3M was 4.0 versus 14.0, down 71.43%, volume 30700 versus 107000. That volume is the food token. There is no mooncakes.io download-count source on Trends API. Do not join 30700 onto moonbit 19.0.

Keyword 7D close 7D baseline 7D growth Tip Saturday
moonbit 19.0 18.0 +5.56% 2026-11-14
moonbit language 5.0 5.0 0.0% 2026-11-14
moonbit programming 0.0 0.0 0.0% 2026-11-14
moonbitlang 0.0 0.0 0.0% 2026-11-14
moonbit compiler 0.0 0.0 0.0% 2026-11-14
mooncakes 4.0 4.0 0.0% 2026-11-14
gleam programming 11.0 9.0 +22.22% 2026-11-07
zig programming 15.0 17.0 -11.76% 2026-11-07
hare programming 8.0 7.0 +14.29% 2026-11-07
php 25.0 38.0 -34.21% 2026-11-07

php volume on that 2026-11-07 tip was 556000 versus 844000. gleam, zig, hare, and php had not rolled to 2026-11-14 when moonbit had. Store recent_date per keyword. The Gleam client pattern is at https://trendsapi.ai/gleam-trends-api.

Did YouTube, News, and Wikipedia agree with Search?

YouTube for moonbit closed at 40.0 versus 12.0, up 233.33%, matching the series close of 40.0 on the 2026-11-14 tip. Adjacent weeks were 12.0, then 23.0, then 0.0, then 26.0. 14D was 40.0 versus 23.0, up 73.91%. 30D was 40.0 versus 26.0, up 53.85%. 3M and 12M compared 40.0 versus 0.0 and printed growth 999999.0. YTD was 40.0 versus 21.0, up 90.48%. Peak was 100.0 on 2021-12-18, then 82.0 on 2021-12-11, 76.0 on 2025-10-04, 70.0 on 2025-10-11, and 60.0 on 2022-01-08 and 2022-10-29. The 2021 peak predates the language. On 2026-07-11 Search printed 100.0 while YouTube printed 24.0. Same 7D sign as Search (+5.56% versus +233.33%), different magnitude, different peak year. YouTube for moonbit programming closed at 0.0 versus 0.0 on every window after a first-try 502 source_unavailable, data_quality low.

Google News for moonbit closed at 0.0 versus 0.0 on every window, data_quality low. Absence of News coverage is a finding. Do not treat 0.0 as a timeout to hide.

Wikipedia title MoonBit printed October 0.0 / 0 views versus September 0.9 / 1 view. 7D and 14D returned collapsed_range. 3M was 0.0 / 0 versus July 0.9 / 1. 12M was 0.0 / 0 versus October 2025 1.9 / 2. Peak was 100.0 / 107 views in March 2025, then 86.0 / 92 in July 2025, 73.8 / 79 in April 2025. Neighbor titles in the same session: WebAssembly October 52.7 / 15039 versus September 28.6 / 11834 (volume +27.08%); Zig (programming language) October 40.2 / 13533 versus September 29.0 / 10554 (volume +28.23%); Gleam (programming language) October 48.1 / 3005 versus September 52.4 / 3127 (volume -3.9%). The MoonBit title at 0 October views is the finding. Search 19.0 is not Wikipedia 0.

A live-rank check on a different query, such as https://trendsapi.ai/blog/mary-peltola-live-rank-vs-weekly-search, still needs get_top_trends with no keyword. Add that call to the same helper rather than inferring rank from get_growth.

How should the helper store the Saturday tip?

Call sources one at a time. Multi-source get_growth can 504. Retry a 502 source_unavailable once, as YouTube moonbit programming did, and store the miss if the retry still returns 0.0. Keep recent_date on every row. moonbit Search, YouTube, and News tipped 2026-11-14 in this session. gleam programming, zig programming, hare programming, and php tipped 2026-11-07. A people-keyword such as mary peltola stayed on 2026-10-31. Three Saturday tips in one run means three calendars.

Store the exact keyword string. moonbit 19.0 is not moonbit programming 0.0 is not moonbit language 5.0 is not moonbitlang 0.0 is not moonbit compiler 0.0 is not mooncakes 4.0 / 30700. A 14D growth of 999999.0 off a 0.0 floor is not a 7D rise of 5.56%. A YouTube peak from 2021-12-18 is not a Search peak from 2026-07-11. Wikipedia volume 0 is not Search 19.0. There is no mooncakes download-count source to join onto any of those rows.