Skip to content
HappyFetch

Cache check

POST /v1/cache is free. It says how old our copy of a company is, and what a lookup would cost now.

POST https://api.happyfetch.net/v1/cache

Free. Before you look a company up, ask how old our copy is. Then decide: take it from the cache for less, or pay for a fresh fetch with max_age.

Request#

Send the body you'd send to the lookup, with one of these:

FieldTypeMeaning
urlstringA company reference, as for POST /v1/company.
domainstringA website, as for POST /v1/domain.
max_ageinteger, secondsOptional: the max_age you'd send with the lookup. Defaults to its cache TTL.

Send exactly one of url and domain. Input the lookup would reject is rejected here too, with the same error codes, and nothing is ever charged.

Example#

curl https://api.happyfetch.net/v1/cache --max-time 120 \
  -H "Authorization: Bearer $HAPPYFETCH_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://www.linkedin.com/company/stripe"}'

Response#

The answer for Stripe's company page, three days after we fetched it:

200 OK
{
  "data": {
    "lookup": "company",
    "cached": true,
    "answer": "company",
    "fetched_at": "2026-09-20T09:00:00.000Z",
    "age_seconds": 259200,
    "max_age_seconds": 604800,
    "from_cache": true,
    "price_credits": 1,
    "fetch_price_credits": 2
  },
  "meta": {
    "request_id": "5d0a9c3e-71f2-4b86-a4e0-c29b8f1d6a37",
    "endpoint": "cache",
    "credits_charged": 0,
    "credits_remaining": 200
  }
}
FieldMeaning
lookupcompany or domain: the lookup the answer is about.
cachedWhether we hold an answer for it.
answercompany, or not_found when what we hold is the answer that there's no company page (for a numeric id, no public page: unresolvable_id). When the company copy is too old for your max_age and a newer not-found answer is held, it's the not-found, as in the lookup. null when nothing is cached.
fetched_at, age_secondsWhen we got that answer, rounded down to the start of its hour, and how old it is counted from there (86400 seconds is a day). null when nothing is cached.
max_age_secondsThe oldest answer the lookup accepts: your max_age, or its default. For a not-found answer, the not-found window that applies, at most a day.
from_cacheWhether the lookup, sent now with this body, would be answered from our cache.
price_creditsWhat that lookup costs now: the cache price, 0 for a not-found from the cache, or the fetch price.
fetch_price_creditsWhat it costs fetched fresh, with max_age: 0.

The answer says nothing about which company it is: that's what the lookup is for. Its times are to the hour, so the check gives out no exact fetch times; the lookup's own meta.cache has the exact time. from_cache and price_credits go by that rounded age, so within an hour of the max_age limit the check can predict a fetch where the lookup would still answer from the cache. It never predicts a lower price than the lookup charges.

meta holds the request id and credits_charged, which is always 0.

Price#

Free. Calls count toward your API key's rate limit like any other.