Hamelyn API & Developer Documentation

Hamelyn is a Spanish re-commerce platform: we buy and sell second-hand books, music, movies and video games. This page documents the public Hamelyn API v6 at https://api.hamelyn.com and the official CLI, for developers and AI agents.

Quickstart

No account is needed for the public endpoints:

# Service health
curl https://api.hamelyn.com/api/v6/health

# Public catalog lookup by EAN / ISBN
curl https://api.hamelyn.com/api/v6/catalog/9780140449136

# Full OpenAPI 3.1 specification (all endpoints, schemas and scopes)
curl https://api.hamelyn.com/openapi.json

Authentication

All non-public endpoints require a bearer token in the Authorization header. Two token types are accepted:

Machine-readable auth metadata: RFC 9728 protected-resource metadata (includes scopes_supported). Unauthenticated requests receive 401 with a WWW-Authenticate: Bearer resource_metadata="…" hint.

The public endpoints need no key. Read-only scopes are self-served through the CLI once your account has the cli role — request it via contact if your login does not have it yet.

Scopes

ScopeGrants
read:stocksInventory stock items and product data
read:ordersPurchase orders from sellers
read:ordersellsMarketplace and store sales
read:marketplacesMarketplace sync status
read:metaDomain enums and operation catalog
read:bqRead-only BigQuery analytics queries
manage:tokensMint, list and revoke API tokens
write scopesPer-domain write scopes (write:orders, write:stocks, …) — restricted; each one is listed in the OpenAPI spec

Each operation in the OpenAPI spec declares the exact scopes it requires in its security section. A missing scope returns 403 listing the required and missing scopes.

Error model

Every /api/v6 response uses a stable JSON envelope; errors are never HTML:

{ "ok": false, "error": { "code": "UNAUTHORIZED", "message": "Missing Authorization header" } }

Codes: BAD_REQUEST, VALIDATION_ERROR (400) · UNAUTHORIZED, INVALID_TOKEN, TOKEN_EXPIRED, TOKEN_REVOKED (401) · FORBIDDEN (403) · NOT_FOUND (404) · CONFLICT (409) · RATE_LIMITED (429) · INTERNAL_ERROR (500). Every response carries an x-request-id header for support.

Rate limits

Authenticated endpoints: 300 requests per minute per token. Public catalog lookups: 60 requests per minute per IP, with CDN caching. Responses carry IETF rate-limit headers (RateLimit-Policy, RateLimit); exceeding the limit returns 429 with Retry-After.

Pagination & conventions

Official CLI

# macOS
curl -fsSL https://api.hamelyn.com/cli/install.sh | sh

# Windows (PowerShell)
irm https://api.hamelyn.com/cli/install.ps1 | iex

hamelyn auth login       # OAuth device flow + token minting
hamelyn stock list       # typed access to the API

Machine-readable resources

When to use the Hamelyn API

Selling flow for end users: hamelyn.com · Store: tienda.hamelyn.com · Questions: contact.