API Endpoint - lookup

  • Endpoint URL: https://api.osbn.io/v1/lookup/{OSBN number}
  • HTTP Method: GET
  • Headers:
    • Authorization: {token}

Description:

The lookup REST API endpoint allows you to retrieve book information based on the OSBN (a unique 17-digit identifier) by making a GET request.

Request Parameters:

  1. URL segment (slug): The OSBN to lookup. Can be in the format OSBN-01-001-000001-001-8 or OSBN010010000010018 or 010010000010018
  2. Authorization (Header): The authorization header is used to authenticate the request. You should include a valid token to access the API.

Example cURL Command:

curl https://api.osbn.io/v1/lookup/OSBN-01-001-000001-001-8 -H "Authorization: Wmp6ADsd8PtWfMODoaYMXNHIjhHA5Ws"

Responses:

  • If the request is successful and the provided token is valid, you will receive a JSON response containing the book information.
  • If the request is unauthorized or if the book with the given OSBN is not found, appropriate error responses will be provided.
Response Example (Success):
	{
		"id": 2,
		"osbn": "OSBN-01-001-000001-001-4",
		"title": "The Book Of Arne",
		"subtitle": "A Short European Literary Exposition",
		"author_name": "Arne Hemingway",
		"publisher_name": "AHEM Books",
		"publication_date": "2023-10-04",
		...
		// Other book details
	}
	
Response Example (Unauthorized):
	{
		"error": "Unauthorized",
		"message": "Invalid authorization token."
	}
	
Response Example (Book Not Found):
	{
		"error": "Not Found",
		"message": "The book with OSBN-01-001-000001-XXX-2 was not found."
	}