API Documentation for Developers

Introduction

Welcome to the NumberInWord.com API documentation. Our API enables developers to integrate our number-to-word conversion tools directly into their applications, websites, and services. With simple RESTful endpoints, you can convert numbers to words, generate ordinal numbers, convert Roman numerals, and more.

This documentation provides everything you need to start using our API, including authentication, available endpoints, request parameters, and response formats.

Getting Started

To use the NumberInWord.com API, you'll need an API key. You can obtain one by registering for a developer account. We offer free and paid tiers based on usage requirements.

Authentication

All API requests require an API key passed either as a query parameter ?api_key=YOUR_API_KEY or in the request headers as X-API-Key: YOUR_API_KEY.

Base URL

All API endpoints use the following base URL:

https://api.numberinword.com/v1

Available Endpoints

Number to Words Conversion

GET /convert/number-to-words

Converts a numeric value to its word representation.

Parameters

Parameter Type Required Description
number number Yes The numeric value to convert
language string No Language code (default: en-US)
format string No Output format (options: standard, hyphenated, capitalized)

Example Request

GET https://api.numberinword.com/v1/convert/number-to-words?number=12345&format=standard&api_key=YOUR_API_KEY

Example Response

{ "status": "success", "data": { "number": 12345, "words": "twelve thousand three hundred forty-five", "format": "standard" } }

Ordinal Number Conversion

GET /convert/ordinal

Converts a number to its ordinal word form.

Parameters

Parameter Type Required Description
number number Yes The number to convert
format string No Output format (options: word, numeral)

Example Request

GET https://api.numberinword.com/v1/convert/ordinal?number=21&format=word&api_key=YOUR_API_KEY

Example Response

{ "status": "success", "data": { "number": 21, "ordinal": { "word": "twenty-first", "numeral": "21st" } } }

Rate Limits and Usage

Our API implements rate limiting to ensure fair usage across all users:

  • Free tier: 100 requests per day
  • Basic tier: 1,000 requests per day
  • Premium tier: 10,000 requests per day
  • Enterprise tier: Custom limits

Rate limit information is included in the response headers:

  • X-RateLimit-Limit: Your total daily request limit
  • X-RateLimit-Remaining: Remaining requests for the current day
  • X-RateLimit-Reset: Time (in Unix seconds) when the limit resets

Error Handling

The API uses conventional HTTP response codes to indicate success or failure:

  • 200 OK: Request successful
  • 400 Bad Request: Invalid parameters
  • 401 Unauthorized: Missing or invalid API key
  • 429 Too Many Requests: Rate limit exceeded
  • 500 Server Error: Something went wrong on our end

Error responses include details about what went wrong:

{ "status": "error", "code": 400, "message": "Invalid number format. Please provide a valid numeric value." }

Code Examples

For more detailed implementation examples in various programming languages, visit our Code Examples page.