A Gleam 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 Gleam library. gleam_httpc wraps Erlang httpc. gleam_json parses the envelope, then parses the body string a second time. Pulled on 2026-10-25, Google Search for gleam programming scored 7.0 for the week of 2026-10-24, up 16.67% from 6.0. gleam language scored 5.0, flat versus 5.0. Those two tokens closed 2 points apart, programming phrase above language. YouTube for gleam programming scored 5.0, down 37.5% from 8.0. Do not copy bare gleam Search 35.0 onto a language-adoption alert that only watches the phrase token at 7.0. The same helper that stores those rows also pulls a live Google Trends board. A rank-13 name that weekly Search printed at 43.0 versus 19.0 is documented in Wildwood live rank versus weekly Search.

How does a Gleam 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":"gleam programming","percent_growth":["7D","30D","3M","12M"]}
import envoy
import gleam/dynamic/decode
import gleam/http
import gleam/http/request
import gleam/httpc
import gleam/io
import gleam/json

pub fn main() {
  let assert Ok(key) = envoy.get("TRENDSAPI_API_KEY")
  let assert Ok(base) = request.to("https://api.trendsapi.ai/api")
  let payload =
    "{\"mode\":\"get_growth\",\"source\":\"google search\",\"keyword\":\"gleam programming\",\"percent_growth\":[\"7D\",\"30D\",\"3M\",\"12M\"]}"
  let req =
    base
    |> request.set_method(http.Post)
    |> request.set_header("authorization", "Bearer " <> key)
    |> request.set_header("content-type", "application/json")
    |> request.set_body(payload)

  let assert Ok(resp) = httpc.send(req)
  let envelope_decoder = {
    use status_code <- decode.field("statusCode", decode.int)
    use body <- decode.field("body", decode.string)
    decode.success(#(status_code, body))
  }
  let assert Ok(#(_code, inner)) =
    json.parse(from: resp.body, using: envelope_decoder)
  let results_decoder = {
    use results <- decode.field("results", decode.list(decode.dynamic))
    decode.success(results)
  }
  let assert Ok(_rows) = json.parse(from: inner, using: results_decoder)
  io.println("parsed body a second time")
}

request.to builds the URL. request.set_method sets POST. Header keys on gleam_http are lowercase. json.parse on the transport bytes, then json.parse again on the body string. Docs live at:

https://hexdocs.pm/gleam_httpc/
https://hexdocs.pm/gleam_json/
https://hexdocs.pm/envoy/envoy.html
https://hexdocs.pm/gleam_http/gleam/http/request.html
https://gleam.run

Add the packages from Hex. That is the client install, not a Trends API source:

gleam add gleam_httpc@5 gleam_json@3 envoy

The response envelope is {"statusCode": int, "body": string}. body is a JSON string and must be parsed a second time before reading recent_value. An Elixir client that does the same double parse with Req and Jason is on Elixir Trends API. An Erlang client is on Erlang Trends API.

What did get_growth return for Gleam language tokens?

get_growth for gleam programming on google search tips on 2026-10-24. Store the exact strings. gleam language is a different series. The programming phrase sat 2 points above the language phrase on the same week, with opposite 7D signs.

Keyword Period Recent date Recent Baseline date Baseline Growth
gleam programming 7D 2026-10-24 7.0 2026-10-17 6.0 +16.67%
gleam programming 14D 2026-10-24 7.0 2026-10-10 0.0 vs 0.0
gleam programming 30D 2026-10-24 7.0 2026-09-26 0.0 vs 0.0
gleam programming 3M 2026-10-24 7.0 2026-07-25 0.0 vs 0.0
gleam programming 12M 2026-10-24 7.0 2025-10-25 0.0 vs 0.0
gleam programming YTD 2026-10-24 7.0 2026-01-03 26.0 -73.08%
gleam language 7D 2026-10-24 5.0 2026-10-17 5.0 0.0%
gleam language 14D 2026-10-24 5.0 2026-10-10 9.0 -44.44%
gleam language 30D 2026-10-24 5.0 2026-09-26 0.0 vs 0.0
gleam language 3M 2026-10-24 5.0 2026-07-25 12.0 -58.33%
gleam language 12M 2026-10-24 5.0 2025-10-25 15.0 -66.67%
gleam language YTD 2026-10-24 5.0 2026-01-03 20.0 -75.0%
gleamlang 7D 2026-10-24 0.0 2026-10-17 0.0 0.0%
gleam compiler 7D 2026-10-24 3.0 2026-10-17 0.0 vs 0.0
gleam 7D 2026-10-24 35.0 2026-10-17 38.0 -7.89%
gleam 12M 2026-10-24 35.0 2025-10-25 50.0 -30.0%
gleam YTD 2026-10-24 35.0 2026-01-03 37.0 -5.41%

get_time_series for gleam programming on Google Search closed at 7 on 2026-10-24, matching get_growth 7.0. Adjacent weeks: 6 on 2026-10-17, 0 on 2026-10-10, 0 on 2026-10-03, 0 on 2026-09-26, 21 on 2026-09-12. Peak in this pull is 100 on 2024-03-16, with 55 on 2024-03-23 and 36 on 2026-06-06. Tip 7 is not that March 2024 high. 12M versus 0.0 is the week of 2025-10-25. The payload printed growth 999999 on 14D, 30D, 3M, and 12M because those baselines were 0.0. Report 7.0 versus 0.0. 7D printed +16.67% versus 6.0, the opposite sign from YTD -73.08% versus 26.0. A job that alerts on 7D +16.67% while YTD sits at -73.08% versus 26.0 is reading a one-week bounce off 6.0, not a new peak.

gleam language closed at 5.0, flat versus 5.0. Opposite 7D sign from gleam programming, 2 points below, programming sat higher. 14D was 5.0 versus 9.0 (-44.44%). 3M was 5.0 versus 12.0 (-58.33%). 12M was 5.0 versus 15.0 (-66.67%). Do not copy 7.0 onto gleam language 5.0.

gleamlang closed at 0.0 versus 0.0 on every window. The payload marked data_quality low with a warning that the underlying signal is over 90% zeros. That concatenated string is not package-download volume.

gleam compiler closed at 3.0 versus 0.0 on every window, also data_quality low. Report 3.0 versus 0.0. Do not copy compiler 3.0 onto programming 7.0.

Bare gleam closed at 35.0, down 7.89% from 38.0. 14D was 35.0 versus 46.0 (-23.91%). 30D was 35.0 versus 60.0 (-41.67%). 12M was 35.0 versus 50.0 (-30.0%). YTD was 35.0 versus 37.0 (-5.41%). That five-character string mixes jewelry, other products, and the language. Do not treat Search 35.0 as Gleam language adoption. There is no Hex.pm source on this API.

Neighbor languages on the same pull, same source, same 7D window:

Keyword 7D recent 7D baseline 7D growth 12M recent 12M baseline 12M growth
gleam programming 7.0 6.0 +16.67% 7.0 0.0 vs 0.0
gleam language 5.0 5.0 0.0% 5.0 15.0 -66.67%
elixir programming 20.0 18.0 +11.11% 20.0 55.0 -63.64%
erlang 17.0 18.0 -5.56% 17.0 29.0 -41.38%
rust programming 22.0 23.0 -4.35% 22.0 30.0 -26.67%
vlang 19.0 16.0 +18.75% 19.0 84.0 -77.38%
zig programming 16.0 20.0 -20.0% 16.0 49.0 -67.35%
odin programming 16.0 19.0 -15.79% 16.0 26.0 -38.46%
nim programming 15.0 14.0 +7.14% 15.0 40.0 -62.5%
jai programming 13.0 17.0 -23.53% 13.0 11.0 +18.18%
hare programming 7.0 8.0 -12.5% 7.0 0.0 vs 0.0
c3 programming 8.0 10.0 -20.0% 8.0 37.0 -78.38%
crystal programming 3.0 5.0 -40.0% 3.0 19.0 -84.21%

gleam programming 7.0 sat 13 points below elixir programming 20.0 and 10 points below erlang 17.0. It matched hare programming 7.0 on the new Saturday tip. gleam language 5.0 sat 2 points below gleam programming. Do not copy elixir 20.0 onto gleam programming 7.0. A prior calendar-day pull on the previous Saturday tip printed hare programming at 8.0 versus 4.0. Today that neighbor reprinted to 7.0 versus 8.0 on the new week. zig programming reprinted from 20.0 versus 21.0 to 16.0 versus 20.0. odin programming reprinted from 19.0 versus 23.0 to 16.0 versus 19.0. Store the session pull. Same-tip reprints are not a new week. This pull is a new Saturday tip. A Hare Trends API helper stores the systems-language neighbor on the same 7D window. A Zig Trends API helper stores zig programming.

What did YouTube, News, and Wikipedia return?

YouTube for gleam programming closed below Search on the 0-100 score, with the opposite 7D sign. Keyword Google News for both Gleam phrases printed zeros. Wikipedia titles resolve on their own. Compare Wikipedia on volume.

YouTube for gleam programming tipped 5.0 on 2026-10-24, down 37.5% from 8.0, while Search rose 16.67% to 7.0. The payload marked data_quality low. 14D, 30D, 3M, 12M, and YTD baselined at 0.0. Report 5.0 versus 0.0 for those. get_time_series closed at 5, matching get_growth. Adjacent weeks: 8 on 2026-10-17, then 0, 0, 0. Peak in this pull is 100 on 2024-07-06, with 89 on 2024-12-28 and 78 on 2025-01-25. Those three non-zero YouTube points sit months apart. On 2024-03-16 Search printed 100 while YouTube printed 0. On 2024-07-06 YouTube printed 100 while Search printed 20. YouTube 5.0 is not Search 7.0. Do not treat the YouTube floor as language adoption while Search sits at 7.0 after a 100 close in March 2024.

YouTube for gleam language closed at 10.0, down 33.33% from 15.0, 5 points above programming YouTube 5.0 and 5 points above language Search 5.0. Later windows baselined at 0.0. Report 10.0 versus 0.0. The payload marked data_quality low. Do not copy language YouTube 10.0 onto programming YouTube 5.0.

Keyword Google News for gleam programming printed 0.0 versus 0.0 on every window, also data_quality low. Store the zeros. Keyword Google News for gleam language printed 0.0 versus 0.0 on every window, also data_quality low. Keyword news volume for gleam programming printed 0.0 versus 0.0 on 7D with 0 articles versus 0. 30D printed 0.0 versus 20.0 with 0 articles versus 1. YTD printed 0.0 versus 20.0 with 0 articles versus 1. Do not fill News from Search 7.0. Keyword News and the Google News Top News board are different feeds. Mode docs sit at https://trendsapi.ai/docs.

Wikipedia for Gleam (programming language) resolved. September 2026 scored 52.4 with 3,127 pageviews versus August 39.5 with 2,766 (volume +13.05%). 3M was 52.4 / 3,127 versus June 42.5 / 2,850 (volume +9.72%). 12M was 52.4 / 3,127 versus September 2025 58.3 / 3,291 (volume -4.98%). YTD was 52.4 / 3,127 versus January 59.7 / 3,332 (volume -6.15%). 7D and 14D collapsed (collapsed_range: recent and baseline resolved to the same monthly point). Peak in this pull is 100.0 / 4,458 in December 2025. Short title Gleam resolved to a different page. September scored 6.3 with 95 pageviews versus August 8.6 with 111 (volume -14.41%). Do not join 3,127 views onto Search 7.0. Do not treat short-title Gleam at 95 views as the language page. The language title is the finding. Wikipedia source docs sit at https://trendsapi.ai/trends/wikipedia-trends.

There is no Hex.pm source on this API. npm covers npmjs. python covers PyPI. A Gleam watchlist that wants package downloads has no third source to join onto Search 7.0.

How does a watchlist store live boards next to weekly scores?

get_top_trends has no keyword. Pair the live Google Trends board with get_growth on the exact board string. Live rank, 1-day rank_change, and 7-day rank_change are three feeds. The rank snapshot can stamp at the same second as the mover snapshot, or two hours earlier.

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

{"mode":"get_top_trends","type":"Google Trends","limit":25}

On 2026-10-25T10:01:33Z the live Google Trends board ranked wildwood at 13. The 1-day rank_change sort stamped the same second, returned 25 rows (baseline 2026-10-24T02:01:42Z), and listed that token at +23 from 36. The 7-day sort returned 1 row (baseline 2026-10-18T02:01:38Z): wildwood at +179 from 192. Weekly Search for that exact string scored 43.0 versus 19.0, up 126.32%. The helper that stores those rows is the blog in this batch: Wildwood live rank versus weekly Search. The same live board ranked php at 7 with weekly Search 100.0 versus 22.0 and estimated volume 2,200,000. Do not copy php 100.0 onto gleam programming 7.0. Board-shape notes for Google Trends live feeds sit at https://trendsapi.ai/trends/google-trends.

Free tier is 100 successful 200s per month. Only 200 responses count against quota. Five language tokens plus one live board is 6 calls. A Monday run that also pulls YouTube and Wikipedia for the programming phrase is 8 calls. Four weeks is 32 calls and still fits the free cap. Starter is 5,000, Pro 25,000, Business 100,000.

Envelope checklist

  1. POST https://api.trendsapi.ai/api with Authorization: Bearer <api_key>.
  2. Parse the transport JSON, then parse the body string a second time.
  3. Store gleam, gleam programming, gleam language, and gleamlang as separate series.
  4. Compare Wikipedia Gleam (programming language) on volume at 3,127 September views, not short-title Gleam at 95.
  5. Pair get_top_trends rank with both rank_change windows and get_growth on the exact board string.