HonestHook

RankingsSign in

Home · Docs · Recipes · What was trending the day a competitor launched

What was trending the day a competitor launched

Point `from` and `to` at one past day and read back the ranking as the archive recorded it. This is the question no live API can answer.

4 steps, using 2 endpoints. Step 1 is free and needs no key.

Read these first — they cost money if you do not

3 measured caveats apply to this recipe. They are worth more than the steps below: each one is a way the API answers plausibly while meaning something other than what you assumed.

A nonexistent niche is not a 404 — and it spends the call

Nothing validates the niche name. A typo returns `items: []` with `points: 0` and HTTP 200, AND still spends a call, because the quota counter increments before the archive is read. An empty answer therefore means one of two different things — the niche is quiet, or the niche does not exist — and the response does not distinguish them. This is why step 1 of every recipe here resolves names at `/api/v1/nichos` first: that endpoint is free and needs no key, so the check costs nothing.

Source: The `/api/v1/trends/{niche}` description in the served `/openapi.json`.

An unknown parameter is ignored in silence

`/trends` declares exactly four inputs: `niche`, `from`, `to` and `limit`. Anything else is not rejected — it is ignored. A `?platform=hackernews` produces no error, no warning and no filtering: you get the unfiltered answer and nothing tells you the filter did not apply. Check the parameter against the list before assuming a narrower result.

Source: The declared parameter list in `lib/rotas-da-api.js` and the published `/openapi.json`.

The series is capped, and says when it was cut

`/trends` is capped at 5000 series points and a 90-day span, both enforced in the database. When a cap is hit, `truncated` is true and the series is incomplete — narrow the interval rather than drawing conclusions from a partial series. `limit` is a hint only: the hard cap lives in the database and a larger value does not raise it.

Source: The `/api/v1/trends/{niche}` description in the served `/openapi.json`.


The 4 steps

1. Resolve the niche name first — it is free, and skipping it costs

Nothing validates a niche name downstream, so a typo answers 200 with an empty list and still spends a call. This endpoint needs no key and costs no credits, so there is never a reason to guess. Take the `id` values from the response and use those verbatim.

$ curl -s "https://honesthook.com/api/v1/nichos"
{"niches":[{"id":"ai-agents","label":"AI agents","windows_24h":24,"last_window":"2026-10-02T09:00:00+00:00"},{"id":"devtools","label":"Developer tools","windows_24h":24,"last_window":"2026-10-02T09:00:00+00:00"},{"id":"indie-saas","label":"Indie SaaS","windows_24h":24,"last_window":"2026-10-02T09:00:00+00:00"}]}
Real response, HTTP 200, captured for this page.

2. Check the archive actually reaches that day

`windows_24h` and `last_window` in the step above tell you about now, not about the day you care about. The archive only answers for windows it recorded — it was not running before it started, and no parameter will conjure a window that was never captured. If the date you want predates collection you will get an empty list, which is the same shape as a quiet day.

Watch for: This is the step most people skip, and the one that makes an empty answer look like a finding instead of a gap in coverage.

3. Ask for that single day by interval

`from` and `to` are ISO 8601. Bound them to the day in question rather than pulling a week and filtering client-side: the 5000 series-point cap applies to what the query matches, so a wide interval can truncate the day you actually wanted.

$ curl -H "Authorization: Bearer hk_live_..." \
     "https://honesthook.com/api/v1/trends/devtools?from=2026-09-18T00:00:00Z&to=2026-09-19T00:00:00Z"
No response body here. The 200 body for this call is NOT transcribed on this page. Reading it needs a client key, and there is no client key on the machine these pages were built from — internal keys exist only as hashes, by design. Rather than show you a plausible example we never received, we show the field-by-field shape from the contract and link the schema page. The shape is guarded against the live contract by a test; an invented example would be guarded by nothing.

Watch for: `entered_at` and `left_at` on each item tell you whether it was already in the ranking before your window opened. An item with `entered_at` inside the day is a genuine arrival; one with an earlier `entered_at` was already there.

4. Do not try to filter by platform here

`/trends` declares four inputs and `platform` is not one of them. Adding it changes nothing and warns about nothing — you get the unfiltered day back and a filter you believe applied. Group by the `platform` field on each item instead, after the fact.

$ curl "https://honesthook.com/api/v1/trends/ai-agents?hours=168"
{"error":"chave_ausente"}

HTTP 401
Real response, HTTP 401, captured for this page. The command as issued carries `hours`, which `/trends` does not declare — it is a `/movers` parameter. That is not what the 401 shows, though: the refusal happens before any parameter is read, so this transcript says nothing about how an unknown parameter is treated. The silent-discard warning below comes from the declared parameter list, not from this response.

The shapes that come back

This recipe touches 3 response schemas. Each is documented field by field, generated from the contract and tested against it:

The endpoints used

What this page does not show you

The 200 bodies for the calls that need a key are not transcribed anywhere on this page, and that is deliberate rather than unfinished. Reading them needs a client key, there is no client key on the machine these pages were built from, and an example we never received would be indistinguishable from one we did — to you, and eventually to us. The field-by-field shape is on the schema pages above and is checked against the live contract by a test; an invented example would be checked by nothing.

The other 2 recipes

← All recipes · Schemas · Endpoint reference · Full docs