Quickstart

Start using the BARFLAB public API to work with pets, diets, measurements, and products.

API overview

The BARFLAB API lets you manage pets and diets, record measurements, search products, and generate diet proposals. Use the API base address shown in the technical reference below.

Get access

Create an access token in your account settings. Keep it in a server-side environment variable or a local script, and never expose it in browser code.

Make your first request

Use the request shown below to list the pets owned by the connected account. An account without pets returns an empty list.

Work with diets

Generating a proposal does not save it. Save the returned diet explicitly, then read the saved diet to retrieve it together with its analysis.

A diet can belong to one pet or to one shared batch for an ordered group of compatible pets. The shared response includes each pet’s analysis and portion and remains directly saveable. Clients that support shared batches must request them explicitly when listing or reading diets.

API base URL
https://api.barflab.io
curl
curl --fail-with-body --silent --show-error \
  https://api.barflab.io/v1/pets \
  -H "Authorization: Bearer $BARFLAB_TOKEN" \
  -H 'Accept: application/json'
200 application/json
{"items": []}
Diet operations
POST /v1/diet-generations
POST /v1/diets
GET /v1/diets/{dietId}