A Java Trends API client is a Bearer-authenticated POST to https://api.trendsapi.ai/api, then a second Jackson parse of the body string. On 2026-09-04, Google Search for java scored 47.0 for the week of 2026-08-29, down 18.97% from 58.0 on 2026-08-22, with estimated volume 1,610,000. spring boot scored 21.0, down 79.0% from 100.0 on 2026-05-30. kotlin scored 28.0, down 72.0% from the same 100.0 three-month baseline. YouTube for java sat at 74.0. Wikipedia resolved Java (programming language) to score 0.0 with 39,088 August views. The language term and the framework terms do not move together. Store them as separate rows.
How does a Java client call Trends API?
The HTTP shape is one POST. Mode, source, and keyword sit in the JSON body. Auth is Authorization: Bearer. Java 11 HttpClient is enough. Jackson ObjectMapper 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":"java","percent_growth":["7D","30D","3M","12M"]}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.charset.StandardCharsets;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
public final class TrendsClient {
private static final String API = "https://api.trendsapi.ai/api";
private static final ObjectMapper MAPPER = new ObjectMapper();
public static JsonNode post(String jsonBody) throws Exception {
String key = System.getenv("TRENDSAPI_API_KEY");
HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create(API))
.header("Authorization", "Bearer " + key)
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(jsonBody, StandardCharsets.UTF_8))
.build();
HttpResponse<String> res = HttpClient.newHttpClient()
.send(req, HttpResponse.BodyHandlers.ofString());
if (res.statusCode() != 200) {
throw new IllegalStateException("HTTP " + res.statusCode());
}
JsonNode envelope = MAPPER.readTree(res.body());
// body is a JSON string; parse it a second time
return MAPPER.readTree(envelope.get("body").asText());
}
}
The first mistake most clients make is reading envelope.get("body").get("results"). That fails because body is still a string. Call asText() and parse again. Official HttpClient docs are on the Java 21 HttpClient API. Jackson lives at jackson-databind.
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 Java language terms?
Pulled on 2026-09-04 with source set to google search. Recent points land on 2026-08-29.
| Keyword | Period | Recent | Baseline date | Baseline | Growth | Est. volume |
|---|---|---|---|---|---|---|
| java | 7D | 47.0 | 2026-08-22 | 58.0 | -18.97% | 1,610,000 |
| java | 14D | 47.0 | 2026-08-15 | 59.0 | -20.34% | 1,610,000 |
| java | 30D | 47.0 | 2026-08-01 | 60.0 | -21.67% | 1,610,000 |
| java | 3M | 47.0 | 2026-05-30 | 76.0 | -38.16% | 1,610,000 |
| java | 12M | 47.0 | 2025-08-30 | 57.0 | -17.54% | 1,610,000 |
| java | YTD | 47.0 | 2026-01-03 | 47.0 | 0.0% | 1,610,000 |
| spring boot | 7D | 21.0 | 2026-08-22 | 31.0 | -32.26% | |
| spring boot | 30D | 21.0 | 2026-08-01 | 52.0 | -59.62% | |
| spring boot | 3M | 21.0 | 2026-05-30 | 100.0 | -79.0% | |
| spring boot | 12M | 21.0 | 2025-08-30 | 47.0 | -55.32% | |
| kotlin | 7D | 28.0 | 2026-08-22 | 37.0 | -24.32% | |
| kotlin | 30D | 28.0 | 2026-08-01 | 65.0 | -56.92% | |
| kotlin | 3M | 28.0 | 2026-05-30 | 100.0 | -72.0% | |
| kotlin | 12M | 28.0 | 2025-08-30 | 64.0 | -56.25% |
java YTD is flat at 47.0 versus 47.0 on 2026-01-03. spring boot and kotlin both peaked at 100.0 on 2026-05-30 and now sit at 21.0 and 28.0. A 3M alert on the language term fires at -38.16%. The same window on the framework terms fires at -79.0% and -72.0%. Keep the keywords split.
get_time_series for java on Google Search puts the 47.0 tip in a 261-point weekly pull. The series peak is 100 on 2022-03-26 with volume 3,419,847. The 2026-08-29 week is 47 with volume 1,607,328. That is not a new high. It is a holiday-week dip under a 2022 peak.
Source field notes for Search sit on Google Trends. The Python sibling of this client is Python Trends API.
What did YouTube, News, and Wikipedia return for java?
Same pull day. YouTube and Google News use weekly tips on 2026-08-29. Wikipedia is monthly; 7D and 14D collapsed to the same point.
| Source | Keyword resolved | Period | Score | Volume | Baseline score | Growth |
|---|---|---|---|---|---|---|
| youtube | java | 7D | 74.0 | 85.0 | -12.94% | |
| youtube | java | 30D | 74.0 | 76.0 | -2.63% | |
| youtube | java | 3M | 74.0 | 66.0 | +12.12% | |
| youtube | java | 12M | 74.0 | 69.0 | +7.25% | |
| google news | java | 7D | 31.0 | 100.0 | -69.0% | |
| google news | java | 30D | 31.0 | 21.0 | +47.62% | |
| google news | java | 3M | 31.0 | 9.0 | +244.44% | |
| google news | java | 12M | 31.0 | 3.0 | +933.33% | |
| wikipedia | Java (programming language) | 30D | 0.0 | 39,088 | 0.3 | -100.0% |
| wikipedia | Java (programming language) | 12M | 0.0 | 39,088 | 3.2 | -100.0% |
YouTube for java is 74.0, up 12.12% over 3M, while Search is down 38.16% over the same window. Google News scored 31.0 on 2026-08-29 after 100.0 on 2026-08-22. Print both weeks. A 7D news drop of 69.0% is a coverage spike fading, not a language-adoption crash.
Wikipedia keyword java resolved as title Java with 44,621 views and score 21.8 for 2026-08-01. Keyword Java (programming language) resolved to score 0.0 with 39,088 views. Those are different pages. Compare Wikipedia rows on recent_volume, not on the 0-100 score. Do not join 44,621 island-or-disambiguation views onto 1,610,000 Search estimated volume. Wikipedia pageview fields are on Wikipedia Trends.
How should a Java 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-04T08:01:31Z, Google Trends rank 7 was mapquest while weekly Search for that keyword was still 23.0. The walkthrough that stores that split is MapQuest live rank vs weekly Search.
JsonNode board = TrendsClient.post(
"{\"mode\":\"get_top_trends\",\"type\":\"Google Trends\",\"limit\":25}"
);
JsonNode growth = TrendsClient.post(
"{\"mode\":\"get_growth\",\"source\":\"google search\","
+ "\"keyword\":\"mapquest\",\"percent_growth\":[\"7D\",\"30D\",\"12M\"]}"
);
int rank = board.get("data").get(6).get(0).asInt();
double score = growth.get("results").get(0).get("recent_value").asDouble();
Index 6 is rank 7 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 Java job of three Search keywords plus one board is 4 calls. Sixteen calls per 30-day month fits the 100-request free tier. Daily polling of that set is about 120 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 descriptive keywords. 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 Node sibling of this helper is Node Trends API. A scheduled runner that wraps the same POST is GitHub Actions Trends API. No SDK is required. A 40-line HttpClient class covers growth, series, and board pulls for jobs that already run on cron.