Bookshops Directory API Documentation

Access our comprehensive bookstore database with simple pay-per-use pricing

💰 Simple Pay-per-Use Pricing

$0.01
per request
100
Free requests per month
$0
Setup fees
$0
Monthly minimum
✅ No monthly fees • ✅ No setup costs • ✅ Pay only for what you use

🚀 Getting Started

1

Get your API key

Sign up for API access to get your API key instantly. No approval process required.

2

Make your first request

Use your API key to make requests to our endpoints:

curl -H "Authorization: Bearer YOUR_API_KEY" \\
     https://bookshopfinder.co.uk/api/bookstores

Search bookstores:

curl -H "Authorization: Bearer YOUR_API_KEY" \\
     "https://bookshopfinder.co.uk/api/bookstores/search?q=london"

Get bookstores by city:

curl -H "Authorization: Bearer YOUR_API_KEY" \\
     https://bookshopfinder.co.uk/api/bookstores/city/London

Get bookstores by tags:

curl -H "Authorization: Bearer YOUR_API_KEY" \\
     https://bookshopfinder.co.uk/api/bookstores/tag/fiction,coffee
3

Monitor your usage

Track your API usage and charges through the response headers or build a dashboard using our usage endpoint.

📡 API Endpoints

Bookstores

GET/api/bookstores

Get all bookstores

GET/api/bookstores/city/{city}

Get bookstores by city

GET/api/bookstores/tag/{tags}

Get bookstores by tag(s) - supports comma-separated tags

GET/api/bookstores/search?q={query}

Search bookstores by name, city, or address

GET/api/bookstores/{slug}

Get a specific bookstore by slug

Cities

GET/api/cities

Get all cities with bookstore counts

GET/api/cities/popular?max={number}

Get popular cities (default max: 15, max allowed: 100)

🔐 Authentication

All API requests require authentication using an API key. Include your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Keep your API key secure and never expose it in client-side code.

📊 Usage Tracking

Every API response includes usage information in the headers:

X-Usage-Total: 45
X-Usage-Charge: 0.001
X-Usage-Free-Limit: 100
X-RateLimit-Remaining: 55
X-Usage-Total:Current month request count
X-Usage-Charge:Cost of this request (USD)
X-Usage-Free-Limit:Free requests per month
X-RateLimit-Remaining:Remaining free requests

📄 Example Response

Here's an example response from the /api/bookstores endpoint:

{
  "data": {
    "bookstores": [
      {
        "_id": "abc123",
        "name": "The Literary Cafe",
        "slug": {
          "current": "the-literary-cafe"
        },
        "city": "London",
        "address": "123 Book Street",
        "postcode": "SW1A 1AA",
        "phone": "+44 20 7946 0958",
        "email": "hello@literarycafe.com",
        "links": [
          {
            "_key": "website",
            "title": "Website",
            "url": "https://literarycafe.com",
            "type": "website"
          }
        ],
        "description": "A cozy independent bookshop and cafe...",
        "tags": ["fiction", "coffee", "events"],
        "location": {
          "lat": 51.5074,
          "lng": -0.1278
        },
        "_createdAt": "2023-01-01T00:00:00Z",
        "_updatedAt": "2023-01-01T00:00:00Z"
      }
    ]
  },
  "meta": {
    "total": 1,
    "endpoint": "/api/bookstores",
    "charged": false,
    "chargeAmount": 0
  }
}

⚠️ Error Handling

The API uses standard HTTP status codes and returns error details in JSON format:

{
  "error": {
    "message": "Invalid API key",
    "code": "INVALID_API_KEY",
    "status": 401
  }
}
200:Success
401:Invalid or missing API key
404:Resource not found
500:Internal server error

💬 Support

Need help with the API? We're here to help:

Email Support
api@bookshops.com
Documentation
This page covers most use cases