Explore the Prime Numbers API

Try the largest commercial database of prime numbers in the world, with more than 8.1 billion curated primes from the first 200 billion composite numbers and counting!

Make a galaxy of prime numbers your personal playground!

An Amazing API

Whether you're a scientist, security expert, or just love maths,
Prime Numbers API has something to offer you!
Isolated Primes
If you're looking for help with encryption or crypto, gain access to our exclusive isolated primes endpoint and you can filter for rare primes that lie at least 200, and even up to 500+ numbers away from their closest neighbors! The probability of finding an isolated prime number by accident is 1 in over 800,000!
Fully Customizable
The API results configurations range from simple and fast to extensively verbose, with extensive explanations for each field. Whether you're looking for efficient server-to-server communication or for educational or research purposes, the results can be custom-tailored to suit your needs!
Accessible API
We've translated the output into 8 of the most commonly used languages, including Mandarin Mandarin, Hindi Hindi, Spanish Spanish, France French, GermanGerman, Italian Italian, Japan Japanese, and Russian Russian, making the Prime Numbers the most accessible API for finding prime numbers in the world!
100% Genuine
Each prime number you receive from the API is home-grown, curated, and 100% genuine.
It even comes with its very own birth certificate containing time of birth, server signature and full details how long it took to compute it!

No copies, clones, or placeholders here!

How Does It Work

You're only a few simple steps away
1Input

First, choose if want to securely use your own API key and save it bellow. Alternatively, leave it empty, and you will get a general API key, which will give you full access to all the API endpoints.

2Explore

Now you can choose the one of the 5 API endpoints you wish to test and update the form on right to suit your needs, then when you're ready, click Explore!

3Enjoy

Below you'll find your API response and all their corresponding details, translated in the language of your choosing, according to your selections.


Use your own API key?

If already have your own API key and want to securely use it, save it bellow.
Alternatively, leave it empty, and you will get a general API key, which will give you full access to all the API endpoints.

get-random-prime (free)

Returns a random prime number and associated data, including base conversions, prime density, birth certificate, and more! Includes options for detailed explanations, prime senses and prime types! The output is available in 9 languages.

Available with:

  • Free API Plan (for Maths Enthusiasts or for an opportunity to test drive the system for free. The API key expires every 1st of month, but it can be refreshed for free for another month.)
  • Maths is Fun API Plan (for Maths Enthusiasts and Educators alike. The API key has no automatic expiration, but it can be refreshed when needed.)
  • Scientist API Plan (for Big Data, Machine Learning, Artificial Intelligence, Robotics, and Internet of Things Scientists as well as for Web and App Developers. The API key has no automatic expiration, but it can be refreshed when needed.)
  • Expert API Plan (for System Administrators and Security Experts. The API key has no automatic expiration, but it can be refreshed when needed.)
URL: https://api.prime-numbers.io/get-random-prime.php
TYPE: GET
Parameters:

is-this-number-prime (free)

Checks any number between 1 and 10^12 and returns its status as prime or composite, along with all its divisors and associated data. Includes options for detailed explanations, prime senses and prime types! The output is available in 9 languages.

Available with:

  • Free API Plan (for Maths Enthusiasts or for an opportunity to test drive the system for free. The API key expires every 1st of month, but it can be refreshed for free for another month.)
  • Maths is Fun API Plan (for Maths Enthusiasts and Educators alike. The API key has no automatic expiration, but it can be refreshed when needed.)
  • Scientist API Plan (for Big Data, Machine Learning, Artificial Intelligence, Robotics, and Internet of Things Scientists as well as for Web and App Developers. The API key has no automatic expiration, but it can be refreshed when needed.)
  • Expert API Plan (for System Administrators and Security Experts. The API key has no automatic expiration, but it can be refreshed when needed.)
URL: https://api.prime-numbers.io/is-this-number-prime.php
TYPE: GET
Parameters:

prospect-primes-between-two-numbers (paid)

Prospect a range of numbers and receive a plethora of density values and their corresponding explanations and prime types. From isolated primes to Fibonacci density, you're sure to find what you're looking for! Includes options for detailed explanations, prime senses and prime types! The output is available in 9 languages.

Available with:

  • Maths is Fun API Plan (for Maths Enthusiasts and Educators alike. The API key has no automatic expiration, but it can be refreshed when needed.)
  • Scientist API Plan (for Big Data, Machine Learning, Artificial Intelligence, Robotics, and Internet of Things Scientists as well as for Web and App Developers. The API key has no automatic expiration, but it can be refreshed when needed.)
  • Expert API Plan (for System Administrators and Security Experts. The API key has no automatic expiration, but it can be refreshed when needed.)
URL: https://api.prime-numbers.io/prospect-primes-between-two-numbers.php
TYPE: GET
Parameters:

get-all-primes-between-two-numbers (paid)

Returns all prime numbers between two designated start and stop numbers (max 100 results per query). Includes options for detailed explanations, prime senses and prime types! The output is available in 9 languages.

Available with:

  • Scientist API Plan (for Big Data, Machine Learning, Artificial Intelligence, Robotics, and Internet of Things Scientists as well as for Web and App Developers. The API key has no automatic expiration, but it can be refreshed when needed.)
  • Expert API Plan (for System Administrators and Security Experts. The API key has no automatic expiration, but it can be refreshed when needed.)
URL: https://api.prime-numbers.io/get-all-primes-between-two-numbers.php
TYPE: GET
Parameters:

get-isolated-random-prime (paid)

Returns a random prime number value isolated with a minimum combined prime gap of at least 200, and as much as 500, and even assess the level of isolation and % chance to randomly find that number within a million composite numbers! Includes options for detailed explanations, prime senses and prime types! The output is available in 9 languages.

Available with:

  • Expert API Plan (for System Administrators and Security Experts. The API key has no automatic expiration, but it can be refreshed when needed.)
URL: https://api.prime-numbers.io/get-isolated-random-prime.php
TYPE: GET
Parameters:

For Our Developers

We've created GitHub repositories with fully functional code examples,
showcasing how easy is to implement the API endpoints for multiple applications!

Frequently Asked Questions

Prime Numbers API is a tool for requesting prime numbers or data associated with a prime or composite (non-prime) number.  With five endpoints, users can request a random prime number, check if a number is prime, gather all the prime numbers between two numbers, get density values of primes in a certain range, get an isolated random prime that's super far from a neighbor, get tons of information about their results, and more!  Prime numbers are extremely useful to many, including mathematicians, data scientists, and security experts, to name a few.  

They are difficult to acquire, though.  Think about it, how many numbers are there? Infinite--that's how many. How many prime numbers are there? Good question.  How many APIs have had 10 active servers running for years on end, non-stop, to count and calculate each individual number?  One: Prime Numbers API

No other database in the world even comes remotely close to 5+ billion primes and 130+ composite numbers! Prime Numbers API aims to be the one-stop-shop for anyone in need of prime numbers and their respective data. It is a truly unique API.
Visit Prime-Numbers-API.com and register an account.  Choose a plan and enjoy!  The Free Plan is an excellent choice to give our API a test drive!
Absolutely! If you visit our Documentation page and select any of the docs for an endpoint, Get Isolated Random Prime (paid) for example, you can view example requests, their headers, and responses!

We offer four API plans:

  1. Free ($0/month)
  2. Maths is Fun (£7.99 (approx. $12 or €11) /month)
  3. Scientist (£19.99 (approx. $31 or €28) /month)
  4. Expert (£29.99 (approx. $47 or €43) /month)

Here you can view the complete pricing details

The API key is visible in the messages related to each one of the orders.
We offer a multitude of Code Examples, as well as Documentation for each request endpoint, in a host of languages to help you get started with integrating Prime Numbers API calls into your application! 
The output has been translated into the eight most commonly spoken languages in the world, besides english including Mandarin, Hindi, Spanish, France, German, Italian, Japanese, and Russian, making the Prime Numbers the most accessible API for finding prime numbers in the world!

Have more questions?

Check our Documentation, Knowledge Base or Contact us.
We're more than happy to help.

Connect to the largest commercial
database of prime numbers in the world

Whether you're a scientist, security expert, or simply love maths,
Prime Numbers API has something to offer you!