froyo
Sign in Start a directory
All help pages

The API

Read your directory data from your own code.

The API lets your own code read your listings, add new ones and edit them. Use it with tools like Zapier or a script. Every request needs a key.

Turn on the API

  1. Open your directory and select API & MCP.
  2. Turn on Turn on the API and MCP.
  3. Select Save.

While this is off, every API address answers 404, even with a key.

Make a key

  1. Under Keys, fill in Key name, for example Zapier.
  2. Select Create key.
  3. Select Copy and keep the key somewhere safe. We show it once only.

To stop a key working, open its menu and select Revoke. A key works only for the directory it was made in, and only while the API is on.

Send the key

Add this header to every request:

Authorization: Bearer YOUR_KEY

The API address is on the same page, under Addresses. For Good Dog Cafés it is https://gooddogcafes.froyo.app/api. The examples below use that address.

Routes

  • GET /api/fields.json lists the fields.
  • GET /api/listings.json lists live listings, 100 a page. Add ?q= to search and ?page= to move on.
  • GET /api/listings/{slug}.json reads one live listing.
  • POST /api/listings.json adds a live listing.
  • PATCH /api/listings/{slug}.json edits a listing or changes its status.

List the fields

curl https://gooddogcafes.froyo.app/api/fields.json \
  -H "Authorization: Bearer YOUR_KEY"

Each field has a key, a label, a type and its choices. Choices are null unless the type is category.

{"data":[{"key":"name","label":"Name","type":"text","choices":null}]}

List or search listings

curl "https://gooddogcafes.froyo.app/api/listings.json?q=salty" \
  -H "Authorization: Bearer YOUR_KEY"

The answer holds data, total and page. Only live listings appear. Each listing has this shape:

{
  "slug": "salty-paws",
  "url": "https://gooddogcafes.froyo.app/l/salty-paws",
  "fields": {"name": "Salty Paws", "suburb": "Bondi"},
  "lat": -33.891,
  "lng": 151.274
}

lat and lng are null when a listing has no place on the map.

Read one listing

curl https://gooddogcafes.froyo.app/api/listings/salty-paws.json \
  -H "Authorization: Bearer YOUR_KEY"

The answer is the listing shape above. A listing that is hidden or waiting for review answers 404.

Add a listing

curl -X POST https://gooddogcafes.froyo.app/api/listings.json \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"fields":{"name":"Latte House"}}'

Send fields as an object, keyed by field key. A new listing is live at once and answers 201 with the listing shape.

Edit a listing

curl -X PATCH https://gooddogcafes.froyo.app/api/listings/salty-paws.json \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"fields":{"suburb":"Bondi Beach"}}'

Send fields, status or both. Status is live or hidden.

Hide a listing

There is no delete. To take a listing down, set its status to hidden. A hidden listing leaves your site and the API. Send live to bring it back.

curl -X PATCH https://gooddogcafes.froyo.app/api/listings/salty-paws.json \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"status":"hidden"}'

Errors

  • 401: the key is missing, wrong, revoked or from another directory.
  • 404: the API is off, or the listing is not live or does not exist.
  • 422: the request has a problem. The answer has an error and a fields object that names each field at fault, for example "bogus": "There is no such field.".
  • 429: too many requests. Wait a minute and try again.

Limits

You can make 60 reads and 30 writes a minute. Reads use GET. Writes use POST and PATCH. They are counted apart.

Related