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.
| Scope | Allows |
|---|---|
catalog:read | Read products, prices, availability and collections. |
quotes:write | Submit 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.
- Tools:
list_products,get_product,list_collections(these mirror the/v1endpoints) andsearch_products. - Resources:
madelines://dataset/catalog(catalog dataset summary and download links),madelines://dataset/makers(every maker profile),madelines://catalog/products,madelines://catalog/collections,madelines://policies/{shipping-policy|refund-policy|privacy-policy|terms-of-service}andmadelines://guide/agents, plus templatesmadelines://catalog/products/{handle}andmadelines://catalog/collections/{handle}. - Server card: https://api.madelines.co/mcp/server-card.
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.
- Dataset page with field definitions and coverage: https://madelines.co/data/
- Files: catalog.json (one object per product, variants nested), catalog.csv (one row per variant), makers.json, datapackage.json (Frictionless Data Package)
- Blank attribute values mean unknown, never "false". For live price and stock of a single product, use
/v1/products/{handle}.
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."
}
| Code | Status | Meaning |
|---|---|---|
invalid_parameter | 400 | A query or path parameter is out of range or malformed. |
invalid_json | 400 | The request body is not valid JSON. |
missing_token | 401 | No bearer token was sent. |
invalid_token | 401 | The token is expired, malformed or not for this API. |
insufficient_scope | 403 | The token lacks the required scope. |
product_not_found | 404 | No product has that handle. |
not_found | 404 | No such endpoint. |
method_not_allowed | 405 | Wrong HTTP method for this endpoint. |
unsupported_media_type | 415 | Send Content-Type: application/json. |
validation_failed | 422 | The body is JSON but fails the schema. |
endpoint_sunset | 410 | The endpoint passed its sunset date. Use the successor named in the hint. |
rate_limited | 429 | Too many requests. Wait for Retry-After seconds. |
internal_error | 500 | Unexpected server error. Retry, then contact us. |
upstream_error | 502 | The store did not respond as expected. Retry with backoff. |
quotes_unavailable | 503 | Quote intake is temporarily off. Email info@madelines.co. |
Sandbox
Catalog endpoints need no credentials. For everything else there is a self-serve sandbox:
- Register:
POST https://api.madelines.co/oauth/registerreturns aclient_idandclient_secretat once (valid 90 days, scopescatalog:read quotes:write). - Get a token:
POST https://api.madelines.co/oauth/tokenwithgrant_type=client_credentials. - Call the sandbox base URL
https://api.madelines.co/sandbox, for examplePOST 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 carryX-Madelines-Environment: sandbox.
Sandbox credentials always behave as sandbox, on either base URL. Production credentials come from info@madelines.co.
Machine-readable files
- OpenAPI 3.1 spec
- Catalog dataset (JSON, CSV, Data Package)
- Catalog index (catalog.md)
- OAuth protected resource metadata (RFC 9728)
- OAuth authorization server metadata (RFC 8414)
- Command-line tool (madelines.mjs)
- MCP server card
- Agent discovery catalog (ARD / AI Catalog)
- Agent guide (agents.md)
- Versioning and deprecation policy
- llms.txt
- Sitemap