Get list of free numbers
GEThttps://onlinesim.io/api/getFreeList
Returns the countries with free numbers, the free numbers of one country, the SMS received by one of them (paginated) and the list of prohibited services. The answer always has the same shape.
- Without parameters: country
44, its first number. - With
country: that country, its first number. - With
countryandnumber: that country and that number.
Missing or unknown values never cause an error: a country without free numbers is replaced by the
first country of the list, a number that is not among the numbers of the selected country by its
first number. Check messages.country and messages.number to see what was actually selected.
You can use these numbers to receive SMS, for example for testing.
No key is needed. An OAuth token, if sent, must include free-scope; a sent API key is still checked
(an invalid one gives HTTP 456, a blocked account its error). Only GET is accepted; the same method is
also available at /api/getFreeList.php.
The answer is cached for 5 seconds per set of parameters.
Parameters
query8
| Name | Type | Description |
|---|---|---|
country | integer | Country code (according to countries list), or a slug with
Default: 44 |
number | string | Free number without country code whose SMS to show. Must exactly match a number of the selected country, otherwise the first number of that country is used |
page | integer≥ 1 | SMS page number. Values below 1 or non-numeric — 1; a page past the end gives an empty Default: 1 |
count | integer | Number of SMS per page. Values below 10 (and non-numeric) become 10, values above 500 become 500 Default: 10 |
as_country_text | string | If Enum: yes |
with_content | string | If Enum: yes |
locale | string | Language of |
lang | string | Language of the texts in the answer (country and service names, status texts): Enum: frderuenzh |
Responses
200Free countries, numbers and SMS, an OAuth scope error, or a common error of a sent key
application/jsonschemaoneOfSuccessful response, an OAuth scope error, or a common error (only possible when a key or token is sent)
[0]object
[1]object
[2]object
Examples
Successful response79 lines
Returns a list of free numbers and the SMS messages received by them
{
"response": 1,
"countries": [
{
"country": 7,
"country_text": "Россия",
"country_original": "russia"
}
],
"numbers": {
"9915584911": {
"country": 7,
"country_original": "russia",
"data_humans": "6 days ago",
"full_number": "79915584911",
"is_archive": false
}
},
"messages": {
"current_page": 1,
"data": [
{
"id": 512345678,
"text": "Your verification code: 482913",
"in_number": "***2601",
"my_number": "9915584911",
"created_at": "2022-07-24T12:32:14.000000Z",
"data_humans": "1 minute ago",
"code": "482913"
}
],
"first_page_url": "https://onlinesim.io/api/getFreeList?page=1",
"from": 1,
"last_page": 610,
"last_page_url": "https://onlinesim.io/api/getFreeList?page=610",
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "https://onlinesim.io/api/getFreeList?page=1",
"label": "1",
"active": true
},
{
"url": "https://onlinesim.io/api/getFreeList?page=2",
"label": "2",
"active": false
},
{
"url": null,
"label": "...",
"active": false
},
{
"url": "https://onlinesim.io/api/getFreeList?page=610",
"label": "610",
"active": false
},
{
"url": "https://onlinesim.io/api/getFreeList?page=2",
"label": "Next »",
"active": false
}
],
"next_page_url": "https://onlinesim.io/api/getFreeList?page=2",
"path": "https://onlinesim.io/api/getFreeList",
"per_page": 10,
"prev_page_url": null,
"to": 10,
"total": 6100,
"number": "9915584911",
"country": 7
},
"ignore": "<p>…</p><p>…</p>",
"content": null
}The sent OAuth token has no free-scope
{
"response": "Invalid scope(s) provided: free-scope"
}429HTTP 429: more than 400 requests per minute from one profile (from one IP for requests without a key), or more than 200 requests per minute from one profile to getNum, getPrice, getState and setOperationOk together
application/jsonschemaobject
Examples
Request rate limit exceeded
{
"response": "TRY_AGAIN_LATER"
}456HTTP 456: the API key is invalid or the OAuth token has expired. Public methods answer the same way when an invalid key is sent
application/jsonschemaobject
Examples
Invalid API key or expired token
{
"response": "ERROR_WRONG_KEY"
}