Madeline's API

Products, prices and availability from independent makers, plus quote requests for bulk and corporate gifting. Back to the shop

Quickstart

Catalog reads need no key. List five products:

curl -s 'https://api.madelines.co/v1/products?limit=5'

Get one product by its handle (the last part of a product URL):

curl -s 'https://api.madelines.co/v1/products/super-omega-seafood-iceland-sushi-grade-fish-bundle'

Prefer Markdown? madelines.co returns Markdown for the homepage, collection, product, content and blog pages when asked, and /catalog.md lists every collection:

curl -s -H 'Accept: text/markdown' 'https://madelines.co/'

Authentication and scopes

Write operations use OAuth 2.0 client credentials. Get sandbox credentials instantly, with no sign-up, from POST https://api.madelines.co/oauth/register (RFC 7591), or email info@madelines.co for production credentials. Exchange them for a one-hour access token:

curl -s -X POST 'https://api.madelines.co/oauth/register' -H 'Content-Type: application/json' -d '{"client_name":"my-agent"}'
curl -s -X POST 'https://api.madelines.co/oauth/token' \
  -u "$CLIENT_ID:$CLIENT_SECRET" \
  -d grant_type=client_credentials \
  -d scope=quotes:write

Send the token as Authorization: Bearer <token>. Request only the scopes you need.

ScopeAllows
catalog:readRead products, prices, availability and collections.
quotes:writeSubmit bulk-order and corporate-gifting quote requests.

Endpoints

GET /v1/products

Query: limit (1 to 250, default 50), page (default 1). Returns { data, page, limit, next }. Prices are decimal strings in USD.

GET /v1/products/{handle}

One product with variants, prices and availability.

GET /v1/collections

Categories and maker collections, paged like products.

POST /v1/quote-requests

Scope quotes:write. Submit a bulk, gifting, event or office request. Returns 202 with an ID; the team replies by email.

curl -s -X POST 'https://api.madelines.co/v1/quote-requests' \
  -H "Authorization: Bearer $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"contact_email":"you@company.com","kind":"corporate_gifting","quantity":40,"message":"Holiday boxes for clients, about $75 each."}'

Command-line tool

madelines is the official CLI for this API (Node 18+, no dependencies). Catalog commands are read-only and need no credentials; quote uses the client-credentials flow above. It cannot place orders or take payment.

Download the single file and run it with Node:

curl -fsSLO 'https://api.madelines.co/cli/madelines.mjs'
node madelines.mjs products search cheddar
node madelines.mjs products get extra-sharp-cheddar
node madelines.mjs collections --json
MADELINES_CLIENT_ID=... MADELINES_CLIENT_SECRET=... node madelines.mjs quote \
  --email you@company.com --kind corporate_gifting --quantity 40 --message "Holiday boxes" --dry-run

Run madelines --help for every option. --json prints raw API JSON for scripts and agents; exit codes are 0 (ok), 1 (API or network error) and 2 (usage error); on 429 it honors Retry-After.

MCP server

The catalog is also a read-only Model Context Protocol server at https://api.madelines.co/mcp (Streamable HTTP, no credentials). It cannot place orders or take payment.

curl -s -X POST 'https://api.madelines.co/mcp' \
  -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"search_products","arguments":{"query":"cheddar"}}}'

Catalog dataset (CC BY 4.0)

Every product and maker as a download, for analysis or for loading into your own index: prices, makers, origin, the dietary flags, declared allergens, storage, size and uses the store has verified, and the quoted evidence for each value. Free under CC BY 4.0; please credit Madeline's.

curl -s --compressed 'https://madelines.co/data/catalog.csv' -o madelines-catalog.csv

Rate limits

120 requests per 60 seconds per client. Every response carries the IETF RateLimit header fields:

RateLimit-Policy: "default";q=120;w=60
RateLimit: "default";r=118;t=42

r is how many requests you have left and t is seconds until the window resets. Over the limit you get 429 with Retry-After. Limits are counted per Cloudflare location, so r is an estimate; slow down as it approaches 0 and cache catalog reads for about 5 minutes.

Versioning and deprecation

The major version is in the path (/v1). Within v1 we only add things; breaking changes ship as a new major version with at least 6 months' notice. Deprecated endpoints send Deprecation (RFC 9745) and Sunset (RFC 8594) headers and a Link to the policy. Read the full versioning and deprecation policy.

Errors

Errors use RFC 9457 application/problem+json. Each has a stable code and a hint saying what to do next. The token endpoint uses standard OAuth error responses.

{
  "type": "https://api.madelines.co/developers#error-product_not_found",
  "title": "Not Found",
  "status": 404,
  "code": "product_not_found",
  "detail": "No product with handle 'abc'.",
  "hint": "List products with GET /v1/products to find valid handles."
}
CodeStatusMeaning
invalid_parameter400A query or path parameter is out of range or malformed.
invalid_json400The request body is not valid JSON.
missing_token401No bearer token was sent.
invalid_token401The token is expired, malformed or not for this API.
insufficient_scope403The token lacks the required scope.
product_not_found404No product has that handle.
not_found404No such endpoint.
method_not_allowed405Wrong HTTP method for this endpoint.
unsupported_media_type415Send Content-Type: application/json.
validation_failed422The body is JSON but fails the schema.
endpoint_sunset410The endpoint passed its sunset date. Use the successor named in the hint.
rate_limited429Too many requests. Wait for Retry-After seconds.
internal_error500Unexpected server error. Retry, then contact us.
upstream_error502The store did not respond as expected. Retry with backoff.
quotes_unavailable503Quote intake is temporarily off. Email info@madelines.co.

Sandbox

Catalog endpoints need no credentials. For everything else there is a self-serve sandbox:

  1. Register: POST https://api.madelines.co/oauth/register returns a client_id and client_secret at once (valid 90 days, scopes catalog:read quotes:write).
  2. Get a token: POST https://api.madelines.co/oauth/token with grant_type=client_credentials.
  3. Call the sandbox base URL https://api.madelines.co/sandbox, for example POST https://api.madelines.co/sandbox/v1/quote-requests. Reads return live catalog data; quote requests are validated and acknowledged ("sandbox": true) but never sent. Responses carry X-Madelines-Environment: sandbox.

Sandbox credentials always behave as sandbox, on either base URL. Production credentials come from info@madelines.co.

Machine-readable files