A C# Trends API client is a Bearer-authenticated POST to https://api.trendsapi.ai/api, then a second System.Text.Json parse of the body string. On 2026-09-05, Google Search for csharp scored 41.0 for the week of 2026-08-29, down 6.82% from 44.0 on 2026-08-22. The punctuation token c# scored 20.0, down 16.67% from 24.0. The spelled-out token c sharp scored 58.0. dotnet scored 37.0, down 60.64% from 94.0 on 2026-05-30. asp.net scored 11.0, down 86.59% from 82.0 on that same three-month baseline. YouTube for csharp sat at 41.0. Google News for csharp sat at 0.0. Wikipedia resolved C Sharp (programming language) to score 1.2 with 32 August views. Those strings are not one language series. Store them as separate rows.
How does a C# client call Trends API?
The HTTP shape is one POST. Mode, source, and keyword sit in the JSON body. Auth is Authorization: Bearer. HttpClient is enough. System.Text.Json decodes the envelope. The first decode yields statusCode and a body string. The second decode yields results.
POST https://api.trendsapi.ai/api
Authorization: Bearer <api_key>
Content-Type: application/json
{"mode":"get_growth","source":"google search","keyword":"csharp","percent_growth":["7D","30D","3M","12M"]}
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
public static class TrendsClient
{
private static readonly HttpClient Http = new HttpClient();
private const string Api = "https://api.trendsapi.ai/api";
public static async Task<JsonElement> PostAsync(string jsonBody)
{
string key = Environment.GetEnvironmentVariable("TRENDSAPI_API_KEY")
?? throw new InvalidOperationException("missing TRENDSAPI_API_KEY");
using var req = new HttpRequestMessage(HttpMethod.Post, Api);
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", key);
req.Content = new StringContent(jsonBody, Encoding.UTF8, "application/json");
using HttpResponseMessage res = await Http.SendAsync(req);
if ((int)res.StatusCode != 200)
{
throw new InvalidOperationException($"HTTP {(int)res.StatusCode}");
}
string raw = await res.Content.ReadAsStringAsync();
using JsonDocument envelope = JsonDocument.Parse(raw);
// body is a JSON string; parse it a second time
string inner = envelope.RootElement.GetProperty("body").GetString()
?? throw new InvalidOperationException("empty body");
using JsonDocument parsed = JsonDocument.Parse(inner);
return parsed.RootElement.Clone();
}
}
The first mistake most clients make is reading envelope.RootElement.GetProperty("body").GetProperty("results"). That fails because body is still a JSON string. Call GetString() and parse again. HttpClient lives in the System.Net.Http namespace. System.Text.Json is in the shared framework. Official pages:
https://learn.microsoft.com/dotnet/api/system.net.http.httpclient
https://learn.microsoft.com/dotnet/api/system.text.json.jsondocument
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.
What did get_growth return for C# language tokens?
Pulled on 2026-09-05 with source set to google search. Recent points land on 2026-08-29.
| Keyword | Period | Recent | Baseline date | Baseline | Growth |
|---|---|---|---|---|---|
| csharp | 7D | 41.0 | 2026-08-22 | 44.0 | -6.82% |
| csharp | 14D | 41.0 | 2026-08-15 | 43.0 | -4.65% |
| csharp | 30D | 41.0 | 2026-08-01 | 53.0 | -22.64% |
| csharp | 3M | 41.0 | 2026-05-30 | 66.0 | -37.88% |
| csharp | 12M | 41.0 | 2025-08-30 | 64.0 | -35.94% |
| csharp | YTD | 41.0 | 2026-01-03 | 37.0 | +10.81% |
| c# | 7D | 20.0 | 2026-08-22 | 24.0 | -16.67% |
| c# | 30D | 20.0 | 2026-08-01 | 29.0 | -31.03% |
| c# | 3M | 20.0 | 2026-05-30 | 44.0 | -54.55% |
| c# | 12M | 20.0 | 2025-08-30 | 40.0 | -50.0% |
| c# | YTD | 20.0 | 2026-01-03 | 20.0 | 0.0% |
| c sharp | 7D | 58.0 | 2026-08-22 | 60.0 | -3.33% |
| c sharp | 30D | 58.0 | 2026-08-01 | 91.0 | -36.26% |
| c sharp | 3M | 58.0 | 2026-05-30 | 80.0 | -27.5% |
| c sharp | 12M | 58.0 | 2025-08-30 | 64.0 | -9.38% |
| c sharp | YTD | 58.0 | 2026-01-03 | 48.0 | +20.83% |
| .net | 7D | 32.0 | 2026-08-22 | 39.0 | -17.95% |
| .net | 30D | 32.0 | 2026-08-01 | 43.0 | -25.58% |
| .net | 3M | 32.0 | 2026-05-30 | 57.0 | -43.86% |
| .net | 12M | 32.0 | 2025-08-30 | 50.0 | -36.0% |
| .net | YTD | 32.0 | 2026-01-03 | 30.0 | +6.67% |
| dotnet | 7D | 37.0 | 2026-08-22 | 46.0 | -19.57% |
| dotnet | 30D | 37.0 | 2026-08-01 | 71.0 | -47.89% |
| dotnet | 3M | 37.0 | 2026-05-30 | 94.0 | -60.64% |
| dotnet | 12M | 37.0 | 2025-08-30 | 56.0 | -33.93% |
| dotnet | YTD | 37.0 | 2026-01-03 | 35.0 | +5.71% |
| asp.net | 7D | 11.0 | 2026-08-22 | 20.0 | -45.0% |
| asp.net | 30D | 11.0 | 2026-08-01 | 46.0 | -76.09% |
| asp.net | 3M | 11.0 | 2026-05-30 | 82.0 | -86.59% |
| asp.net | 12M | 11.0 | 2025-08-30 | 24.0 | -54.17% |
| asp.net | YTD | 11.0 | 2026-01-03 | 13.0 | -15.38% |
csharp YTD is up 10.81% from 37.0 on 2026-01-03. c# YTD is flat at 20.0 versus 20.0. A 3M alert on csharp fires at -37.88%. The same window on c# fires at -54.55%, on dotnet at -60.64%, and on asp.net at -86.59%. c sharp is a third Search series, not a friendly alias for csharp. Keep the keywords split.
get_time_series for csharp on Google Search puts the 41.0 tip in a 261-point weekly pull. The series hits 100 on 2022-02-19 and again on 2023-02-11. The 2026 high in that pull is 71 on 2026-02-28. The 2026-08-29 week is 41. That is not a new high. It is a late-summer dip under a 2023 peak.
Source field notes for Search sit on Google Trends. The Java sibling of this client is Java Trends API.
What did YouTube, News, and Wikipedia return for csharp?
Same pull day. YouTube and Google News use weekly tips on 2026-08-29. Wikipedia is monthly. 7D and 14D on Wikipedia collapse to the August point.
| Source | Keyword resolved | Period | Score | Volume | Baseline score | Growth |
|---|---|---|---|---|---|---|
| youtube | csharp | 7D | 41.0 | 41.0 | 0.0% | |
| youtube | csharp | 30D | 41.0 | 43.0 | -4.65% | |
| youtube | csharp | 3M | 41.0 | 40.0 | +2.5% | |
| youtube | csharp | 12M | 41.0 | 49.0 | -16.33% | |
| youtube | c# | 7D | 29.0 | 28.0 | +3.57% | |
| youtube | c# | 30D | 29.0 | 27.0 | +7.41% | |
| youtube | c# | 3M | 29.0 | 27.0 | +7.41% | |
| youtube | c# | 12M | 29.0 | 31.0 | -6.45% | |
| google news | csharp | 7D | 0.0 | 0.0 | 0.0% | |
| google news | csharp | 30D | 0.0 | 0.0 | 0.0% | |
| google news | csharp | 3M | 0.0 | 0.0 | 0.0% | |
| google news | csharp | 12M | 0.0 | 0.0 | 0.0% | |
| wikipedia | C sharp (programming language) | 30D | 1.2 | 32 | 1.8 | -33.33% |
| wikipedia | C sharp (programming language) | 12M | 1.2 | 32 | 4.4 | -72.73% |
YouTube for csharp is 41.0, up 2.5% over 3M, while Search is down 37.88% over the same window. YouTube for c# is 29.0 and rising on 7D, 30D, and 3M. Google News for csharp is 0.0 on every window with a low-quality warning (over 90% zeros). Print the zeros. Absence of News coverage is a finding, not a hole to fill with Search.
Wikipedia keyword C Sharp resolved as title C sharp with 71 views and score 1.2 for 2026-08-01. Keyword C Sharp (programming language) resolved as C sharp (programming language) with 32 views and the same 1.2 score. Peak on the programming-language title in this pull is 100.0 with 997 views on 2023-01-01. July 2026 was 1.8 / 38 views. Those are different pages, and both are tiny next to Search. Compare Wikipedia rows on recent_volume, not on the 0-100 score. Do not join 32 or 71 pageviews onto a Search score of 41.0. Wikipedia pageview fields are on Wikipedia Trends.
How should a C# job poll a live board?
get_top_trends takes a feed type, not a keyword. Pair the board with get_growth on the tokens that matter. On 2026-09-05T08:01:32Z, Google Trends rank 1 was what does a mistrial mean. Rank 9 was chatgpt. None of csharp, c#, dotnet, or asp.net appear in that top 25. The walkthrough that stores a live-board token against last week's Search close is Hugging Face vs huggingface Search.
JsonElement board = await TrendsClient.PostAsync(
"{\"mode\":\"get_top_trends\",\"type\":\"Google Trends\",\"limit\":25}"
);
JsonElement growth = await TrendsClient.PostAsync(
"{\"mode\":\"get_growth\",\"source\":\"google search\","
+ "\"keyword\":\"csharp\",\"percent_growth\":[\"7D\",\"30D\",\"12M\"]}"
);
int rank = board.GetProperty("data")[8][0].GetInt32();
double score = growth.GetProperty("results")[0].GetProperty("recent_value").GetDouble();
Index 8 is rank 9 only when the payload is a dense rank list starting at 1. Read the rank field when sort is rank_change. Do not assume array offset equals rank after a mover sort.
A weekly C# job of five Search keywords plus one board is 6 calls. Twenty-four calls per 30-day month fits the 100-request free tier. Daily polling of that set is about 180 calls and needs Starter.
Response envelope checklist
POST https://api.trendsapi.ai/apiwithAuthorization: Bearer <api_key>.- Modes are
get_time_series,get_growth, andget_top_trendsonly. - Parse
bodytwice before readingresultsor dated points. - Google Search uses the exact token typed.
csharp,c#, andc sharpare three series. Wikipedia titles are resolved names; confirm the title before joining volumes. - Quota counts successful 200 responses: free 100/month, then 5,000 / 25,000 / 100,000 on paid tiers.
The Python sibling of this helper is Python Trends API. The Node sibling is Node Trends API. No SDK is required. A 40-line HttpClient class covers growth, series, and board pulls for jobs that already run on cron.