Free Numbers Pricing Reviews Feedback Terms & Policy API Docs Blog About
Log in Get Started
0 views 2 min read
Back to Blog
API & Developers

How to Get Your OtpGet API Key and Make Your First Request in 5 Minutes

How to Get Your OtpGet API Key and Make Your First Request in 5 Minutes

Every OtpGet API call is authenticated with one thing: your personal API key. Getting started takes less time than reading this article.

Step 1: create an account

Register at otpget.com. Registration is free and you can add funds later with the payment method that suits you.

Step 2: copy your API key

Open your dashboard and go to the API tool page. Your key is shown there. Treat it like a password: anyone who holds it can spend your balance. If you think it leaked, generate a new key from the same page.

Step 3: call getBalance

The cheapest and safest first call is getBalance. It spends nothing and proves your key works.

curl "https://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getBalance"

A successful reply looks like this:

ACCESS_BALANCE:125.00

If you see BAD_KEY, the key is wrong or has a typo, often a trailing space from copy and paste.

The same call in PHP and Python

<?php
$key = 'YOUR_API_KEY';
echo file_get_contents('https://otpget.com/stubs/handler_api.php?api_key=' . $key . '&action=getBalance');
import requests
r = requests.get("https://otpget.com/stubs/handler_api.php", params={"api_key": "YOUR_API_KEY", "action": "getBalance"})
print(r.text)

Keep your key safe

  • Never put the key in front-end JavaScript or a public repository.
  • Store it in an environment variable or a server-side config file.
  • Make API calls from your server, not from the visitor's browser.
  • Use the IP whitelist feature so the key only works from your own servers.

What next?

Once getBalance works, try the sandbox key (covered in a separate guide) to test a full purchase without spending anything, then move on to real numbers.

Start building with OtpGet

Create a free account at otpget.com, copy your API key from the dashboard and open the API documentation. Our support team is available 24/7 if you get stuck.

Tags

#OtpGet API key #API authentication #getBalance #first API request
Contact us