DDDailyDog/ API docs

Reference

Errors

Every error is JSON with one envelope and a real HTTP status. code is stable and machine-readable — branch on it; message explains what to fix and may be reworded. A few errors add fields alongside (today only scope, on community-report 429s).

error envelope
{
  "error": {
    "code": "invalid_request",
    "message": "Unknown parameter `grades`."
  }
}
with an extra field
{
  "error": {
    "code": "rate_limited",
    "message": "…",
    "scope": "establishment"
  }
}
StatusCodeMeaningRetry?
400invalid_requestA parameter is missing, out of range, malformed, or unknown (v1.1 list endpoints reject parameters they don't recognize — the message names the offender). Also: a required `X-Device-Id` header is missing, or a JSON body doesn't match its schema.Don't — fix the request. The message says what's wrong.
401unauthorizedMissing, malformed, unknown, or revoked API key. A key that isn't `dd_live_`/`dd_test_` + 40 hex characters is treated as missing.Don't — check the key and the header name.
404not_foundNo record behind that identifier (CAMIS, BBL, slug, photo or avatar id). With a dd_test_ key, also returned for an id outside the fixture city.Don't. Batch endpoints never 404 — misses land in `meta.notFound`.
409conflict`PATCH /v1/profile` only: the username is already taken.Pick another name (`GET /v1/profile/username-check` first).
429rate_limitedYour key's daily limit is spent (resets midnight UTC); the shared playground key's per-IP cap (200/day) is spent; or a community-report cap / the 14-day username rename throttle applies. Community-report 429s add a `scope` field: "establishment" or "device".After midnight UTC for daily limits; 429s never count against your quota.
500internalOur fault — usually an upstream city data source timing out.Yes, with exponential backoff (e.g. 1s, 2s, 4s).

Handling errors

a resilient client (JavaScript)
async function dd(path, init = {}, attempt = 0) {
  const res = await fetch(`https://www.dailydog.ai/api${path}`, {
    ...init,
    headers: { Authorization: `Bearer ${process.env.DAILYDOG_KEY}`, ...init.headers },
  });
  if (res.ok) return res.status === 204 ? null : res.json();

  const { error } = await res.json();
  // Only 500s are worth retrying; 429 means "come back after midnight UTC".
  if (res.status === 500 && attempt < 3) {
    await new Promise((r) => setTimeout(r, 1000 * 2 ** attempt));
    return dd(path, init, attempt + 1);
  }
  throw Object.assign(new Error(error.message), { status: res.status, code: error.code });
}
  • Batch endpoints never 404 on a bad id — misses come back in meta.notFound so one bad id never fails the whole sweep.
  • A 429 isn't always your key's quota. Community-report caps (3 per establishment, 25 citywide, per device per UTC day) and the 14-day username rename throttle also answer 429 — check X-RateLimit-Remaining to tell them apart. See rate limits.
  • 401 on a key that looks right? Keys are dd_live_ or dd_test_ plus 40 hex characters; anything else (a truncated paste, stray quotes) is treated as missing.
  • Stuck? Contact us with the endpoint, the time (UTC), and the error body.