A Zig 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 Zig library. std.http.Client sends the request. std.json parses the envelope, then parses the body string a second time. Pulled on 2026-09-21, Google Search for zig programming scored 14.0 for the week of 2026-09-19, up 7.69% from 13.0. zig language scored 13.0, up 18.18% from 11.0. YouTube for zig programming scored 29.0, up 45.0% from 20.0. Do not treat zig compiler Search 30.0, up 25.0% from 24.0, as language adoption. The same helper that stores those rows also pulls a live Google Trends board; a rank-23 token that weekly Search printed at 16.0 versus 0.0 is documented in converse ad live rank versus weekly Search.

How does a Zig 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":"zig programming","percent_growth":["7D","30D","3M","12M"]}
const std = @import("std");

fn trendsPost(allocator: std.mem.Allocator, payload: []const u8) !std.json.Parsed(std.json.Value) {
    const api_key = std.posix.getenv("TRENDSAPI_API_KEY") orelse return error.MissingApiKey;
    const auth = try std.fmt.allocPrint(allocator, "Bearer {s}", .{api_key});
    defer allocator.free(auth);

    var client = std.http.Client{ .allocator = allocator };
    defer client.deinit();

    var body = std.ArrayList(u8).init(allocator);
    defer body.deinit();

    const res = try client.fetch(.{
        .location = .{ .url = "https://api.trendsapi.ai/api" },
        .method = .POST,
        .payload = payload,
        .extra_headers = &.{
            .{ .name = "Authorization", .value = auth },
            .{ .name = "Content-Type", .value = "application/json" },
        },
        .response_storage = .{ .dynamic = &body },
    });
    if (@intFromEnum(res.status) != 200) return error.HttpNotOk;

    const envelope = try std.json.parseFromSlice(std.json.Value, allocator, body.items, .{});
    defer envelope.deinit();
    const inner = envelope.value.object.get("body") orelse return error.MissingBody;
    // body is a JSON string; parse it a second time
    return std.json.parseFromSlice(std.json.Value, allocator, inner.string, .{});
}

pub fn main() !void {
    var gpa = std.heap.GeneralPurposeAllocator(.{}){};
    defer _ = gpa.deinit();
    const allocator = gpa.allocator();
    const payload =
        \\{"mode":"get_growth","source":"google search","keyword":"zig programming","percent_growth":["7D","30D","3M","12M"]}
    ;
    const parsed = try trendsPost(allocator, payload);
    defer parsed.deinit();
    std.debug.print("{any}\n", .{parsed.value});
}

std.http.Client.fetch and std.json.parseFromSlice are in the Zig standard library. Docs live at:

https://ziglang.org/documentation/master/std/#std.http.Client
https://ziglang.org/documentation/master/std/#std.json

The response envelope is {"statusCode": int, "body": string}. body is a JSON string and must be parsed a second time before reading recent_value. A Clojure client that does the same double parse with clj-http and Cheshire is on Clojure Trends API. A Python client is on Python Trends API.

What did get_growth return for Zig language tokens?

get_growth for zig programming on google search tips on 2026-09-19. Store the exact strings. Bare zig is a different series. The compiler token and the language phrase moved on the same 7D sign and different percents.

Keyword Period Recent date Recent Baseline date Baseline Growth
zig programming 7D 2026-09-19 14.0 2026-09-12 13.0 +7.69%
zig programming 14D 2026-09-19 14.0 2026-09-05 27.0 -48.15%
zig programming 30D 2026-09-19 14.0 2026-08-22 22.0 -36.36%
zig programming 3M 2026-09-19 14.0 2026-06-20 55.0 -74.55%
zig programming 12M 2026-09-19 14.0 2025-09-20 25.0 -44.0%
zig programming YTD 2026-09-19 14.0 2026-01-03 38.0 -63.16%
zig language 7D 2026-09-19 13.0 2026-09-12 11.0 +18.18%
zig language 14D 2026-09-19 13.0 2026-09-05 32.0 -59.38%
zig language 3M 2026-09-19 13.0 2026-06-20 54.0 -75.93%
zig language YTD 2026-09-19 13.0 2026-01-03 29.0 -55.17%
zig 7D 2026-09-19 63.0 2026-09-12 66.0 -4.55%
ziglang 7D 2026-09-19 21.0 2026-09-12 21.0 0.0%
ziglang 14D 2026-09-19 21.0 2026-09-05 90.0 -76.67%
zig compiler 7D 2026-09-19 30.0 2026-09-12 24.0 +25.0%
zig compiler 3M 2026-09-19 30.0 2026-06-20 98.0 -69.39%
zig build 7D 2026-09-19 16.0 2026-09-12 22.0 -27.27%
zig build 3M 2026-09-19 16.0 2026-06-20 100.0 -84.0%

get_time_series for zig programming on Google Search closed at 14 on 2026-09-19, matching get_growth 14.0. Adjacent weeks: 13 on 2026-09-12, 27 on 2026-09-05, 28 on 2026-08-29, 22 on 2026-08-22. Peak in this pull is 100 on 2026-06-06, with 74 on 2026-05-30, 69 on 2026-06-13, 76 on 2025-01-11, and 66 on 2025-12-06. Tip 14 is not that June high. 3M versus 55.0 is the week of 2026-06-20, two Saturdays after the 100 close. A job that alerts on 7D +7.69% while 3M sits at -74.55% is reading a bounce off a post-peak floor, not a new peak.

Bare zig closed at 63.0, down 4.55% from 66.0. 14D was 63.0 versus 81.0 (-22.22%). 12M was 63.0 versus 65.0 (-3.08%). That token mixes the language with other uses of the three-letter string. Do not copy 63.0 onto zig programming 14.0.

ziglang closed at 21.0, flat on 7D versus 21.0. 14D was 21.0 versus 90.0 (-76.67%). 12M printed growth 999999 versus 0.0. Report 21.0 versus 0.0. Do not copy the 14D drop from 90.0 onto the programming phrase.

zig compiler closed at 30.0, up 25.0% from 24.0. 14D was 30.0 versus 51.0 (-41.18%). 12M printed growth 999999 versus 0.0. Report 30.0 versus 0.0. Do not treat a compiler 7D bounce as language adoption. zig build closed at 16.0, down 27.27% from 22.0, the opposite 7D sign from zig programming. 3M was 16.0 versus 100.0 (-84.0%). Language versus toolchain windows diverge on 7D, not only on 3M.

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

Keyword 7D recent 7D baseline 7D growth 3M recent 3M baseline 3M growth
zig programming 14.0 13.0 +7.69% 14.0 55.0 -74.55%
rust programming 16.0 15.0 +6.67% 16.0 40.0 -60.0%
c programming 46.0 48.0 -4.17% 46.0 65.0 -29.23%
go programming 31.0 26.0 +19.23% 31.0 78.0 -60.26%
python programming 32.0 26.0 +23.08% 32.0 60.0 -46.67%
java programming 22.0 22.0 0.0% 22.0 46.0 -52.17%
haskell programming 36.0 29.0 +24.14% 36.0 62.0 -41.94%
clojure programming 18.0 14.0 +28.57% 18.0 45.0 -60.0%
odin programming 21.0 16.0 +31.25% 21.0 81.0 -74.07%
nim programming 21.0 14.0 +50.0% 21.0 53.0 -60.38%

Do not copy odin programming 21.0 or nim programming 21.0 onto zig programming 14.0. Those 7D percents are larger because the baselines sit near 14.0 and 16.0, not because Zig Search closed at 21. haskell programming scored 36.0 versus 29.0 (+24.14%) on this pull. A Rust Trends API helper stores the systems-language neighbor on the same 7D window (16.0 versus 15.0). python programming YTD was 32.0 versus 14.0 (+128.57%). zig programming YTD was 14.0 versus 38.0 (-63.16%). Same calendar, opposite YTD signs.

What did YouTube, News, and Wikipedia return?

YouTube for zig programming closed higher than Search on the 0-100 score and on the 7D percent. Keyword Google News printed zeros. Wikipedia titles resolve on their own. Compare Wikipedia on volume.

YouTube for zig programming tipped 29.0 on 2026-09-19, up 45.0% from 20.0, while Search rose 7.69% to 14.0. 14D was 29.0 versus 30.0 (-3.33%). 30D was 29.0 versus 40.0 (-27.5%). 3M was 29.0 versus 33.0 (-12.12%). 12M was 29.0 versus 51.0 (-43.14%). YTD was 29.0 versus 34.0 (-14.71%). get_time_series closed at 29 on 2026-09-19, matching get_growth. Adjacent weeks: 19 on 2026-09-12, 30 on 2026-09-05, 29 on 2026-08-29, 40 on 2026-08-22. Peak in this pull is 100 on 2026-06-06, the same week Search printed 100, with 76 on 2025-01-18 and 75 on 2023-09-16. Tip 29 is not that June peak. YouTube 29.0 is not Search 14.0. Do not treat the 7D YouTube bounce as language adoption while Search sits at 14.0 after a 100 close three months earlier.

Keyword Google News for zig programming tipped 0.0 versus 0.0 on 7D, 14D, 30D, 3M, 12M, and YTD. The payload marked data_quality low with a warning that the underlying signal is over 90% zeros. Store the zeros. Do not fill News from Search 14.0. Keyword News and the Google News Top News board are different feeds. Mode docs sit at https://trendsapi.ai/docs.

Wikipedia for Zig (programming language) collapsed 7D and 14D (collapsed_range: recent and baseline resolved to the same monthly point). August 2026 scored 43.1 with 13,290 pageviews versus July 79.9 with 23,702 (score -46.06%, volume -43.93%). 3M was 43.1 / 13,290 versus May 90.0 / 26,544 (volume -49.93%). 12M was 43.1 / 13,290 versus August 2025 42.5 / 13,110 (volume +1.37%). YTD was 43.1 / 13,290 versus January 51.9 / 15,786 (volume -15.81%). Peak in this pull is 100.0 / 29,380 in January 2025, with 90.0 / 26,544 in May 2026, 78.0 / 23,168 in June, and 77.0 / 22,869 in December 2025. Compare Wikipedia on volume. Do not join 13,290 views onto Search 14.0. Bare Zig resolved to a different page (August 56.3 / 800 views versus July 89.9 / 1,222). Store both titles. Wikipedia source docs sit at https://trendsapi.ai/trends/wikipedia-trends.

There is no Zig package registry source on this API. npm covers npmjs. python covers PyPI. A Zig watchlist that wants package downloads has no third source to join onto Search 14.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.

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-09-21T10:01:36Z the live Google Trends board ranked converse ad at 23. The 1-day rank_change sort returned 78 rows (baseline 2026-09-20T02:01:45Z) and listed it at +30 from prev_rank 53. The 7-day sort returned 4 rows (baseline 2026-09-14T00:01:29Z) and omitted it. Weekly Search for that exact string scored 16.0 versus 0.0, the first non-zero week in this pull. Brand converse scored 38.0, up 5.56% from 36.0. The helper that stores those rows is the blog in this batch: converse ad live rank versus weekly Search. 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. Six language tokens plus one live board is 7 calls. A Monday run that also pulls YouTube and Wikipedia for the programming phrase is 9 calls. Four weeks is 36 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 zig programming, zig language, ziglang, zig compiler, and zig build as separate series.
  4. Compare Wikipedia Zig (programming language) on volume (13,290 August views), not on 43.1.
  5. Pair get_top_trends rank with both rank_change windows and get_growth on the exact board string.

A Haskell client that uses http-conduit for the same envelope is on Haskell Trends API.