A Prefect flow is a Python function that POSTs to https://api.trendsapi.ai/api with a Bearer key, then parses body a second time because that field is a JSON string. The same contract covers get_growth, get_time_series, and get_top_trends. On 2026-09-01 the python source last complete week for prefect was 2026-08-24 at score 43.6 and 1,679,938 downloads, down from 82.0 and 3,147,593 the week of 2026-08-17. A weekly cron of three PyPI keywords plus one Google Search keyword stays inside the 100-request free tier. Daily polling of that set does not.

How does a Prefect flow call Trends API?

The HTTP shape is one POST. Mode, source, and keyword sit in the JSON body. Auth is Authorization: Bearer. Prefect adds retries, secrets, and a cron deployment around that call.

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

{"mode":"get_growth","source":"python","keyword":"prefect","percent_growth":["7D","30D","12M"]}
import json
import os
import urllib.request

from prefect import flow, task
from prefect.blocks.system import Secret


@task(retries=2, retry_delay_seconds=30)
def get_growth(keyword: str, source: str) -> dict:
    payload = {
        "mode": "get_growth",
        "source": source,
        "keyword": keyword,
        "percent_growth": ["7D", "30D", "12M"],
    }
    key = Secret.load("trendsapi-api-key").get()
    req = urllib.request.Request(
        "https://api.trendsapi.ai/api",
        data=json.dumps(payload).encode("utf-8"),
        headers={
            "Authorization": f"Bearer {key}",
            "Content-Type": "application/json",
        },
        method="POST",
    )
    with urllib.request.urlopen(req, timeout=60) as resp:
        envelope = json.loads(resp.read().decode("utf-8"))
    if envelope.get("statusCode") != 200:
        raise RuntimeError(envelope)
    # body is a JSON string; parse it a second time
    return json.loads(envelope["body"])


@flow
def orchestrator_watchlist():
    prefect_pypi = get_growth("prefect", "python")
    airflow_pypi = get_growth("apache-airflow", "python")
    dagster_pypi = get_growth("dagster", "python")
    prefect_search = get_growth("prefect", "google search")
    return prefect_pypi, airflow_pypi, dagster_pypi, prefect_search

Deploy with a Monday cron (0 10 * * 1) from the Prefect deploy docs. The GitHub Actions equivalent is a workflow YAML cron. See GitHub Actions Trends API for that path. The Python client without an orchestrator is on Python Trends API.

What did prefect PyPI and npm return on 2026-09-01?

get_growth on source python and keyword prefect used recent_date 2026-08-24. That week scored 43.6 with 1,679,938 downloads. The 7D baseline week 2026-08-17 scored 82.0 with 3,147,593 downloads, growth -46.83 percent. The 30D baseline 2026-07-27 scored 85.1 / 3,264,955. The 12M baseline 2025-08-25 scored 43.7 / 1,686,465, growth -0.23 percent. YTD vs 2025-12-29 (34.4 / 1,330,685) was +26.74 percent.

get_time_series on the same source puts the 2026-08-24 week in context. Peak week was 2026-08-03 at 100.0 / 3,835,602. The 2026-08-10 week was 95.7 / 3,670,504. PyPI weekly tips often lag Google weekly sources by about a week, so treat 2026-08-24 as the latest complete python week, not a same-day match for Search week 2026-08-29.

npm is a different registry. Keyword prefect on source npm peaked at 100.0 / 1,182 downloads the week of 2026-08-29. The prior week 2026-08-22 was 91.9 / 1,086. get_growth also returned a partial future-dated week 2026-09-05 at 26.1 / 308. Filter get_time_series to dates on or before 2026-09-01 before computing growth. npm apache-airflow returned 404 data_unavailable on two tries (Airflow is a PyPI project, not an npm package, and the npm fetch also reported a temporary service error).

How do Airflow and Dagster compare on the same python source?

Scores are 0-100 per keyword. Do not rank 43.6 against 20.5 as if they share a scale. Compare absolute recent_volume.

keyword week score downloads 7D baseline week 7D baseline downloads 7D growth
prefect 2026-08-24 43.6 1,679,938 2026-08-17 3,147,593 -46.83%
apache-airflow 2026-08-24 20.5 2,143,430 2026-08-17 4,464,631 -58.92%
dagster 2026-08-24 69.6 1,849,133 2026-08-17 2,644,156 -30.4%

Airflow still led raw downloads that week (2,143,430 vs 1,679,938 vs 1,849,133) even after a steeper 7D drop. Dagster 12M growth was +132.78 percent vs 2025-08-25 (29.9 / 810,284). Prefect 12M was flat (-0.23 percent). Airflow 12M was -42.25 percent vs 2025-08-25 (35.5 / 3,332,094). All three 2026-08-24 weeks sit well below their own 2026-08-17 volumes, which is consistent with a lagging or incomplete PyPI tip week rather than a coordinated product crash.

What does Google Search show against download volume?

Search weeks end 2026-08-29, five days after the latest PyPI week. Keyword prefect scored 29.0, 7D growth -9.38 percent vs 32.0 on 2026-08-22. apache airflow scored 18.0, 7D growth 0.0 vs 18.0. github actions scored 12.0, 7D growth -55.56 percent vs 27.0. 12M Search for prefect was -25.64 percent vs 39.0 on 2025-08-30. Airflow Search 12M was -60.0 percent vs 45.0. GitHub Actions Search 12M was -63.64 percent vs 33.0.

YouTube for prefect was 11.0 on 2026-08-29, 7D growth 0.0 vs 11.0, 12M -8.33 percent vs 12.0. Google News for prefect was 13.0 vs 19.0 on the 7D window (-31.58 percent). The 30D, 3M, and 12M News windows all baselined at 0.0 and returned growth 999999 with a low-quality warning (over 90 percent zeros). Print the raw 13.0 score. Do not store 999999 as a growth feature.

Wikipedia resolved the keyword as Prefect (civic office, monthly). Tip month 2026-08-01 scored 4.3 / 4,658 page views vs July 3.7 / 4,605. 7D collapsed_range. Do not join those page views onto the PyPI row.

How many requests does a weekly watchlist use?

Only HTTP 200 responses count against quota. Free tier 100 per month. Starter 5,000. Pro 25,000. Business 100,000.

The flow above is 4 get_growth calls. Weekly Monday cron is 4 × 4 = 16 in a 30-day month, plus retries. Two retries on a flaky call still stay under 100. Daily cron is 4 × 30 = 120 before retries, which exceeds free. Add a get_top_trends Google Trends board and the weekly total is 5 calls, about 20 per month.

get_growth with comma-separated sources can 504. Call one source per task, which is also how Prefect retries stay scoped to a single source.

How should the flow fail a run?

Raise after the second parse, not on the HTTP 200. A 200 with inner status error or a 404 no_data is a finding. The npm apache-airflow 404 is the example: the task should record data_unavailable and keep the rest of the watchlist. Fail the flow only when a required source (here python for prefect) is missing, or when a stored rule fires, such as prefect PyPI 7D volume growth below -40 percent (the 2026-08-24 week tripped that at -46.63 percent volume growth).

Store recent_date next to the score. Mixing PyPI week 2026-08-24 with Search week 2026-08-29 without the dates is the usual join bug.

Where to go next

Cron without Prefect is documented on cron Trends API. Airflow DAG wiring is a separate thin page at airflow Trends API. Source fields for Google Search are on Google Trends docs. A dated snapshot that a Monday flow would have caught this week is Target costume search vs shopping.