A Haskell 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 Haskell library. http-conduit sends the request. aeson parses the envelope, then parses the body string a second time. Pulled on 2026-09-19, Google Search for haskell programming scored 33.0 for the week of 2026-09-12, down 37.74% from 53.0. haskell language scored 22.0, down 64.52% from 62.0. YouTube for haskell programming scored 11.0, up 1000.0% from 1.0. Do not treat the Search 7D drop as language collapse while YouTube bounces and ghcup Search printed 36.0, up 1100.0% from 3.0. The same helper that stores those rows also pulls a live Google Trends board; a rank-2 token that weekly Search printed at 5.0 is documented in Lizzie Borden live rank versus weekly Search.

How does a Haskell 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":"haskell programming","percent_growth":["7D","30D","3M","12M"]}
{-# LANGUAGE OverloadedStrings #-}

module Main where

import Data.Aeson (Value (..), eitherDecode, encode, object, (.=))
import Data.Aeson.KeyMap qualified as KM
import Data.ByteString.Char8 qualified as BS8
import Data.ByteString.Lazy.Char8 qualified as LBS8
import Data.Text (Text)
import Data.Text.Encoding (encodeUtf8)
import Network.HTTP.Simple
import System.Environment (getEnv)
import System.Exit (die)

trendsPost :: Value -> IO Value
trendsPost payload = do
  key <- getEnv "TRENDSAPI_API_KEY"
  request <- parseRequest "https://api.trendsapi.ai/api"
  let req =
        setRequestMethod "POST" $
        setRequestHeader "Authorization" [BS8.pack ("Bearer " ++ key)] $
        setRequestHeader "Content-Type" ["application/json"] $
        setRequestBodyLBS (encode payload) $
        request
  resp <- httpLBS req
  let code = getResponseStatusCode resp
  if code /= 200
    then die ("HTTP " ++ show code)
    else do
      envelope <- either die pure (eitherDecode (getResponseBody resp))
      case envelope of
        Object o ->
          case KM.lookup "body" o of
            Just (String bodyText) ->
              -- body is a JSON string; parse it a second time
              either die pure (eitherDecode (LBS8.fromStrict (encodeUtf8 bodyText)))
            _ -> die "missing body string"
        _ -> die "envelope is not an object"

main :: IO ()
main = do
  inner <- trendsPost $ object
    [ "mode" .= ("get_growth" :: Text)
    , "source" .= ("google search" :: Text)
    , "keyword" .= ("haskell programming" :: Text)
    , "percent_growth" .= (["7D", "30D", "3M", "12M"] :: [Text])
    ]
  print inner

The first mistake most clients make is treating the body field as an object after one parse. It is still a JSON string. http-conduit returns a lazy ByteString. The first aeson decode yields the envelope. The second parse yields results. Library docs:

https://hackage.haskell.org/package/http-conduit
https://hackage.haskell.org/package/aeson

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. There is no Haskell-specific source on this API. npm covers npmjs package names. python covers PyPI project names. There is no Hackage source. A Haskell watchlist that needs package download counts has to pull those from somewhere else.

What did get_growth return for Haskell language tokens?

Pulled on 2026-09-19 with source set to google search. get_growth tips on 2026-09-12. The prior Saturday 2026-09-05 is the last full week in the same series. Bare haskell is a mixed token. Store the phrase tokens. Do not copy ghc 68.0 or ghcup 36.0 onto haskell programming 33.0.

Keyword Period Recent Baseline date Baseline Growth
haskell programming 7D 33.0 2026-09-05 53.0 -37.74%
haskell programming 14D 33.0 2026-08-29 47.0 -29.79%
haskell programming 30D 33.0 2026-08-15 34.0 -2.94%
haskell programming 3M 33.0 2026-06-13 100.0 -67.0%
haskell programming 12M 33.0 2025-09-13 50.0 -34.0%
haskell programming YTD 33.0 2026-01-03 31.0 +6.45%
haskell language 7D 22.0 2026-09-05 62.0 -64.52%
haskell language 14D 22.0 2026-08-29 43.0 -48.84%
haskell language 3M 22.0 2026-06-13 82.0 -73.17%
haskell language 12M 22.0 2025-09-13 39.0 -43.59%
haskell language YTD 22.0 2026-01-03 25.0 -12.0%
haskell 7D 26.0 2026-09-05 32.0 -18.75%
ghc 7D 68.0 2026-09-05 81.0 -16.05%
ghcup 7D 36.0 2026-09-05 3.0 +1100.0%
cabal haskell 7D 23.0 2026-09-05 100.0 -77.0%
haskell stack 7D 14.0 2026-09-05 32.0 -56.25%
cabal 7D 35.0 2026-09-05 40.0 -12.5%
ocaml 7D 61.0 2026-09-05 88.0 -30.68%
purescript 7D 7.0 2026-09-05 16.0 -56.25%
elm programming 7D 9.0 2026-09-05 1.0 +800.0%
rust programming 7D 14.0 2026-09-05 18.0 -22.22%
julia programming 7D 35.0 2026-09-05 80.0 -56.25%
python programming 7D 37.0 2026-09-05 45.0 -17.78%

haskell programming and YouTube for the same string closed at opposite 7D directions. Search fell 37.74% from 53.0 to 33.0. YouTube rose 1000.0% from 1.0 to 11.0. haskell language fell 64.52% to 22.0, steeper than the programming phrase. Bare haskell scored 26.0, down 18.75% from 32.0. That shallower drop is not the language series. ghcup scored 36.0, up 1100.0% from 3.0. cabal haskell scored 23.0, down 77.0% from 100.0. Do not treat an installer 7D spike or a Cabal 7D crash as language adoption. Bare cabal scored 35.0, a different series. ghc scored 68.0, down 16.05% from 81.0. Do not copy compiler-acronym 68.0 onto haskell programming 33.0.

3M is a summer drop on the phrase tokens. haskell programming is 33.0 versus 100.0 on 2026-06-13 (-67.0%). haskell language is 22.0 versus 82.0 (-73.17%). ocaml 3M is 61.0 versus 70.0 (-12.86%). purescript 3M is 7.0 versus 17.0 (-58.82%). elm programming 3M is 9.0 versus 59.0 (-84.75%). rust programming 3M is 14.0 versus 40.0 (-65.0%). julia programming 3M is 35.0 versus 93.0 (-62.37%). python programming 3M is 37.0 versus 75.0 (-50.67%). ghcup 30D printed growth 999999 versus 0.0 on 2026-08-15. Report 36.0 versus 0.0. cabal haskell 30D and 3M also baselined at 0.0. Report 23.0 versus 0.0. Do not store 999999. Do not copy ocaml 61.0 onto haskell programming 33.0.

YTD signs split. haskell programming is 33.0 versus 31.0 (+6.45%). haskell language is 22.0 versus 25.0 (-12.0%). Bare haskell is 26.0 versus 22.0 (+18.18%). ocaml YTD is 61.0 versus 32.0 (+90.62%). python programming YTD is 37.0 versus 20.0 (+85.0%). julia programming YTD is 35.0 versus 42.0 (-16.67%). rust programming YTD is 14.0 versus 30.0 (-53.33%). elm programming YTD printed growth 999999 versus 0.0. Report 9.0 versus 0.0. Do not copy ocaml YTD +90.62% onto haskell programming. Do not copy phrase-token YTD +6.45% onto haskell language.

get_time_series for haskell programming on Google Search closed at 33 on 2026-09-12, matching get_growth 33.0. Adjacent weeks: 53 on 2026-09-05, 47 on 2026-08-29, 50 on 2026-08-22, 34 on 2026-08-15, 50 on 2026-08-08. The series hit 100 on 2026-06-13, with 95 on 2026-06-06 and 88 on 2026-05-09. The 2026-01-03 close was 31. The 2025-09-13 close was 50. The 7D drop from 53 to 33 sits after that June peak, not at a new high. Tip 33 is the week after a 53 print, not a floor.

The Julia sibling of this helper is Julia Trends API. The Python sibling is Python Trends API.

What did YouTube, News, and Wikipedia return?

YouTube for haskell programming tipped 11.0 on 2026-09-12, up 1000.0% from 1.0 on 2026-09-05, the opposite 7D direction from Search -37.74%. 14D printed growth 999999 versus 0.0 on 2026-08-29. Report 11.0 versus 0.0. Do not store 999999. 30D was 11.0 versus 26.0 (-57.69%). 3M was 11.0 versus 18.0 (-38.89%). 12M and YTD also printed growth 999999 versus 0.0. get_time_series closed at 11 on 2026-09-12, matching get_growth. Adjacent weeks: 1 on 2026-09-05, 0 on 2026-08-29, 21 on 2026-08-22, 26 on 2026-08-15. Peak in this pull is 100 on 2025-02-01 and 2025-02-15, with 93 on 2025-02-08 and 81 on 2025-01-25. Tip 11 is not that February peak. The week of 2026-09-05 printed YouTube 1 while Search that week was 53. Do not copy YouTube 11.0 onto Search 33.0.

Keyword Google News for haskell programming returned HTTP 502 source_unavailable on three pulls during this session. Store the miss. Do not fill News from Search 33.0. Keyword News and the Google News Top News board are different feeds.

Wikipedia resolved two titles. Keyword Haskell (programming language) resolved with August score 2.1 and 1,388 views versus July 0.0 / 810 (score growth 999999, volume +71.36%). Report 2.1 versus 0.0 and 1,388 versus 810. 3M volume was 1,388 versus 942 on 2026-05-01 (score 2.1 versus 0.5, volume +47.35%). 12M volume was 1,388 versus 1,301 on 2025-08-01 (score 2.1 versus 1.8, volume +6.69%). YTD volume was 1,388 versus 1,046 on 2026-01-01 (score 2.1 versus 0.9, volume +32.7%). 7D and 14D collapsed to the same monthly point. get_time_series also printed June 0.9 / 1,062 views and a 2021-11-01 peak of 100.0 / 28,524. Report both score and volume. Tip 1,388 is not that 2021 peak.

Keyword Haskell is a different page. August score 65.9 with 12,508 views versus July 66.4 / 12,610 (score -0.75%, volume -0.81%). 3M volume was 12,508 versus 11,608 (+7.75%). 12M volume was 12,508 versus 12,244 (+2.16%). YTD volume was 12,508 versus 12,910 (-3.11%). The short title has more August views than the language page (12,508 versus 1,388). Compare Wikipedia on volume. Do not join either page onto Search 33.0. Notes for the Wikipedia source sit on Wikipedia Trends.

There is no Hackage source. npm and PyPI package names are not Haskell package names. A job that needs Cabal or Stack download counts has to pull those from somewhere else.

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

get_top_trends has no keyword. It returns a ranked board. Pair it with get_growth for the tokens that appear, using the exact board string.

{"mode":"get_top_trends","type":"Google Trends","limit":25}
{"mode":"get_top_trends","type":"Google Trends","sort":"rank_change","window":"1d","limit":25}

The Google Trends board at 2026-09-19T10:01:41Z ranked how do i register to vote 1, lizzie borden 2, and duncan sheik 12. The 1-day rank_change sort (64 rows, baseline 2026-09-18T02:01:34Z) listed duncan sheik with rank_change 136 from prev_rank 148 and omitted lizzie borden. The 7-day sort returned 3 rows and omitted both. Weekly Search for lizzie borden was 5.0, up 66.67% from 3.0. Live rank can catch a token that both mover lists still miss. The walk-through is Lizzie Borden live rank versus weekly Search.

A Haskell watchlist that stores six Search tokens (haskell programming, haskell language, ghcup, ocaml, rust programming, elm programming) plus one Google Trends board uses 7 successful 200s. Four runs per 30-day month is 28 calls and fits the free cap of 100. Daily polling of that set is about 210 calls and needs Starter (5,000). Modes and sources for the modes live at https://trendsapi.ai/docs. Google Search board strings are not always valid get_growth keywords. Pair get_top_trends rank, rank_change, and get_growth before writing an alert. Source notes for Search sit on Google Trends.

The Elixir sibling of this helper is Elixir Trends API. The Rust sibling is Rust Trends API.

Envelope checklist

  1. POST https://api.trendsapi.ai/api with Authorization: Bearer <api_key>.
  2. Modes are get_time_series, get_growth, and get_top_trends only.
  3. Parse body twice before reading results or dated points.
  4. Google Search uses the exact token typed. haskell, haskell programming, haskell language, ghcup, and cabal haskell are five series. Wikipedia titles are resolved names; confirm the title and compare on volume before joining. There is no Hackage source.
  5. Quota counts successful 200 responses: free 100/month, then 5,000 / 25,000 / 100,000 on paid tiers.

No Haskell library is required. A 50-line http-conduit helper covers growth, series, and board pulls for jobs that already run under systemd or a cron timer.