Documentation

Recipe API Documentation

Complete reference guide to integrate with our Recipe API. Access thousands of recipes with simple REST endpoints.

Need an API key?

Create an account to get started with your free API key

Get API Key

Introduction

The Recipe API provides programmatic access to a database of delicious recipes from around the world. With this API, you can retrieve recipes with detailed ingredients and cooking instructions, search for recipes by cuisine or keyword, and more.

Base URL

https://brecipes-fastify.onrender.com/api/recipes

Response Format

All API responses are returned in JSON format. Successful responses typically include the requested data, while error responses include an error message.

Rate Limiting

The API implements rate limiting to ensure fair usage and service stability:

  • 100 requests per minute per IP address
  • Applies to all recipe endpoints
  • When exceeded, the API returns a 429 Too Many Requests response

Authentication

The Recipe API supports two authentication methods: API Keys and JWT tokens. Most endpoints require authentication using either method.

API Key authentication is the simplest method for accessing the API. Include your API key in each request's header:

X-API-Key: your-api-key-here

You can obtain your API key by registering for an account.

Example Request with API Key

curl -X GET 'https://brecipes-fastify.onrender.com/api/recipes' \
  -H 'X-API-Key: your-api-key-here' \
  -H 'Content-Type: application/json'

User Endpoints

API Key Endpoints

Recipe Endpoints

All recipe endpoints require authentication using either an API key or a JWT token.

  • API Key: Include the X-API-Key header with your API key.
  • JWT Token: Include the Authorization header with your JWT token.

Show more endpoints

Error Handling

The API uses standard HTTP status codes to indicate the success or failure of a request.

Status Codes

  • 200 OK - The request was successful
  • 201 Created - A new resource was created successfully
  • 204 No Content - The request was successful but no content was returned
  • 400 Bad Request - The request was invalid or malformed
  • 401 Unauthorized - Authentication failed or was not provided
  • 403 Forbidden - The authenticated user does not have permission to access the resource
  • 404 Not Found - The requested resource was not found
  • 429 Too Many Requests - Rate limit exceeded
  • 500 Internal Server Error - An unexpected error occurred on the server

Error Response Format

Error responses have a consistent format:

{
  "error": "Error message describing the problem"
}

Example Error Responses

401 Unauthorized

{
  "error": "Authentication required"
}

403 Forbidden

{
  "error": "Access denied"
}

404 Not Found

{
  "error": "Recipe not found"
}

429 Too Many Requests

{
  "error": "Rate limit exceeded. Try again in X seconds"
}

Ready to start building?

Get your API key now and start integrating delicious recipes into your application.