Get Your SMSFeel API Key and First Request
If you are building an app that needs phone verification, you do not want to buy numbers by hand. You want your code to order a number, read the SMS, and finish the verification without a human touching it. That is what the SMSFeel API is for, and getting started takes about five minutes: an account, a key, and one test request. This guide shows you where your SMSFeel API key lives, how to make your first request, and the mistakes that waste your first hour. Everything about the API here comes from the live docs, so read the docs alongside this guide before you write your own calls.
What the SMSFeel API key is
Your API key is a long string that identifies your account to the API, and it works like a password, so treat it like one. Every request you make must include your API key in the query string as ?api_key=YOUR_KEY, and without it the API will not know who you are. The docs are the Developer Portal v2.0, and they list the SMS OTP handler as https://smsfeel.com/stubs/handler_api.php, with responses in JSON. Rentals use a separate handler at /stubs/rental-handler.php, premium numbers use /stubs/premium-handler.php, and email OTP uses /stubs/email-handler.php, so the handler you call depends on the kind of number you want.
You send a request with your key and an action, and the API answers with a JSON object that tells you whether it worked and what came back. The docs also list a webhook, or push, option in the menu, so you can have codes pushed to you instead of asking for them again and again. That matters later, when your code is polling for a code, but for your first five minutes, the key and one test request are enough.
Where to find your SMSFeel API key
Registration is free, so start by creating an account on smsfeel.com if you do not have one. Then open the developer or API section in your SMS Feel dashboard or account area, where your API key is shown. The exact label may vary, but the key itself is a long string, and it is the only thing the API needs to recognise you. Copy it carefully, and store it in an environment variable on your server, not in your code. Never paste it into a public code repository, a screenshot, or a chat message, because anyone with the key can spend your balance. If a key is ever leaked, generate a new one and stop using the old one at once.
Before you write any code, open the live API docs at the SMSFeel docs and read the getting started section. The docs are the source of truth for the actions, the parameters and the answers, and this guide only covers the first steps, so check each action there before you use it. The OTP API page gives a short overview of what the API can do, and the complete guide to buying virtual numbers with the SMSFeel SMS API walks through the same flow in more detail, so those two pages are good company for your first session.
Your first request: check your balance
The best first request is the one that cannot spend any money: checking your balance. The action is called getBalance, and the call looks like this: https://smsfeel.com/stubs/handler_api.php?api_key=YOUR_KEY&action=getBalance. Replace YOUR_KEY with your real key, and send the request from your browser or from a small script. The answer comes back as JSON, like this: {"success": true, "action": "getBalance", "data": {"balance": "125.00"}}. If you see that shape, your key works, the handler is reachable, and you are ready for the next step.
Notice what the answer tells you. The success field says the request worked. The action field repeats the action you asked for, so you can match answers to requests. And the data field carries the result, here a balance of 125.00. Prices and balances are in PKR by default, with an optional ¤cy=XXX parameter if you want another currency, so that 125.00 is in rupees unless you asked otherwise. A guide to checking servers, countries and services with the API is the natural next read, because those actions tell you what is available before you spend anything.
Your second request: order a number and read the code
Once the balance check works, the next step is to order a number. The action for that is getNumber, and it orders a number for a service, for example WhatsApp or Telegram, and returns the number and an order ID. The service name must match the app you are verifying, so check it in the docs before you send the request. A wrong service name orders a number the app will not accept, and that is one of the most common first hour mistakes.
After you have the number, your code needs to wait for the SMS. The action for that is getStatus, which tells you whether a code has arrived and what it is, and getStatusV2 is a newer form of the same check. Your code asks for the status every few seconds until the code appears, then reads it and finishes the verification. When you are done, setStatus finishes or cancels the order. The guide to buying a temporary number with getNumber covers the order step in detail, and the guide to getStatus and setStatus for codes, refunds and finishing orders covers the rest of the flow. The other actions in the docs, getCurrencies, getServers, getCountries, getServices and getPrice, are the ones you use to check what is available and what it costs before you order.
What the answers mean: HTTP codes and JSON
Every answer has two layers: the HTTP code and the JSON body. The HTTP code tells you at a glance whether the request worked. A 401 means a bad key, so check the key you sent. A 402 means insufficient balance, so top up before you retry. A 404 means not found, so check the handler and the action name. And a 502 means an upstream error, so wait a little and try again rather than hammering the API with repeats.
The JSON body carries the detail. A successful answer has success set to true, the action you asked for, and a data object with the result. Read the whole body when you are testing, not just the one field you wanted, because the extra fields often explain what happened. Log the full response for your first few requests, and keep those logs while you build. The guide to API rate limits and polling without being throttled is worth reading here too, because polling too fast is the mistake that turns a working script into a throttled one.
Mistakes that waste your first hour
The most common mistake is polling too fast. The API has rate limits, and asking for the status every second will get you throttled. Poll on a sensible interval, a few seconds apart, and stop the moment the code arrives. The second mistake is using the wrong service name, which orders a number the app will not accept. Check the service name in the docs, and test with a cheap service first.
The third mistake is forgetting that a one-time number expires. If your test takes longer than the number lives, the code is gone, and no amount of polling will bring it back. The fourth mistake is putting the key in the code itself. Use an environment variable, and use a separate key for testing if your dashboard offers one. And the fifth is building on a guess instead of the docs. Prices depend on country, app and number type, and are shown inside your account after sign-in, so check the pricing page and the live price in your account rather than hard coding a figure into your script. For anything real, a rental kept active is safer than a one-time number, because the number stays yours while you need it. And never use the API to create bulk accounts or to get around a platform's rules. That is abuse, and it will get the key and the account banned.
Frequently Asked Questions
Where is my SMSFeel API key?
Create an account on smsfeel.com, then open the developer or API section in your SMS Feel dashboard or account area. Your key is shown there. Store it in an environment variable, never in public code.
How do I make my first API request?
Send a getBalance request to the SMS OTP handler: https://smsfeel.com/stubs/handler_api.php?api_key=YOUR_KEY&action=getBalance. A JSON answer with success true and your balance means the key works.
What does a 401 error mean?
A 401 means a bad key. Check the key you sent, copy it again from your dashboard, and make sure it is in the query string as ?api_key=YOUR_KEY.
What does a 402 error mean?
A 402 means insufficient balance. Top up your account before you try to order a number, because an order with no balance behind it will fail.
Which handler should I use for rentals?
Rentals use /stubs/rental-handler.php, while one-time SMS OTP uses /stubs/handler_api.php. Premium numbers use /stubs/premium-handler.php and email OTP uses /stubs/email-handler.php. Check the docs for the actions each handler supports.