Need to validate ISBN numbers in your application? This guide covers everything you need to know about ISBN validation via API, including ISBN-10 and ISBN-13 formats, checksum algorithms, and implementation examples in multiple languages.
What is an ISBN?
An ISBN (International Standard Book Number) is a unique numeric commercial book identifier assigned to each edition and variation of a publication. ISBNs are used by publishers, booksellers, libraries, and internet retailers for ordering, listing, and stock control.
A typical ISBN-13 looks like this: 978-3-16-148410-0
ISBN Formats Explained
There are two ISBN formats in use:
ISBN-10 (Legacy Format)
The original 10-digit format used before 2007. Contains a check digit calculated using modulo 11 arithmetic. The check digit can be 0-9 or X (representing 10).
ISBN-13 (Current Standard)
The current 13-digit format introduced in 2007. Based on EAN-13 barcode standard. Always starts with 978 or 979. Uses modulo 10 checksum like EAN codes.
Using the ISBN Validator API
TinyFn provides a simple endpoint to validate ISBNs:
GET https://api.tinyfn.io/v1/validate/isbn?isbn=978-3-16-148410-0
Headers: X-API-Key: your-api-key
{
"valid": true,
"isbn": "9783161484100",
"isbn_formatted": "978-3-16-148410-0",
"format": "ISBN-13",
"check_digit": "0",
"isbn10_equivalent": "3-16-148410-X"
}
Parameters
| Parameter | Type | Description |
|---|---|---|
isbn |
string | ISBN to validate (required) |
Code Examples
JavaScript / Node.js
const response = await fetch(
'https://api.tinyfn.io/v1/validate/isbn?isbn=978-3-16-148410-0',
{ headers: { 'X-API-Key': 'your-api-key' } }
);
const result = await response.json();
console.log(result.valid); // true
console.log(result.format); // "ISBN-13"
Python
import requests
response = requests.get(
'https://api.tinyfn.io/v1/validate/isbn',
params={'isbn': '978-3-16-148410-0'},
headers={'X-API-Key': 'your-api-key'}
)
result = response.json()
print(result['valid']) # True
print(result['format']) # "ISBN-13"
cURL
curl "https://api.tinyfn.io/v1/validate/isbn?isbn=978-3-16-148410-0" \
-H "X-API-Key: your-api-key"
Common Use Cases
- Bookstores: Validate ISBNs during inventory management
- Libraries: Verify book identification numbers
- Publishing: Validate ISBNs before print production
- E-commerce: Ensure accurate product listings
- Book APIs: Validate user input before database lookups
Best Practices
- Accept both formats: Support both ISBN-10 and ISBN-13 input
- Normalize input: Remove hyphens and spaces before validation
- Store consistently: Store ISBNs in ISBN-13 format for consistency
- Display formatted: Show ISBNs with hyphens for readability
Use via MCP
Your AI agent can call this tool directly via Model Context Protocol — no HTTP code needed. Add TinyFn to Claude Desktop, Cursor, or any MCP client:
{
"mcpServers": {
"tinyfn-validate": {
"url": "https://api.tinyfn.io/mcp/validate/",
"headers": {
"X-API-Key": "your-api-key"
}
}
}
}
See all validation tools available via MCP in our Validation MCP Tools for AI Agents guide.
Try the ISBN Validator API
Get your free API key and start validating ISBNs in seconds.
Get Free API Key