Rental data by provider
GET /api/rent.php?method=getdataWithProviders
Send a GET request and check status in the JSON response: 1 means success and 0 means failure, even with HTTP 200. If it fails, read msg for the reason.
Authentication
The apikey query parameter is optional. Omit it for public data; set it for account-specific data or pricing where documented.
Parameters
| Name | Location | Type | Required | Example | Description |
|---|---|---|---|---|---|
method | query | string | Yes | "getdataWithProviders" | Method name |
apikey | query | string | No | (optional) | Optional API key. When supplied, it may affect personalized rental data and prices. |
country | query | string | Yes | "KZ" | Country code of number Countries list |
dtype | query | string | No | "week" | Type of period: week or month Defaults to week when omitted. |
dcount | query | integer | No | 1 | Count type of period, i.e. if dtype=week then counts of weeks Defaults to 1 when omitted. |
extend | query | string | No | "1" | Optional flag enabling extended response format. |
How to use this method
Compare the services available in a country, their daily prices and the providers supplying them. Use the same dtype and dcount that you plan to rent.
Choose a country from Rental countries, then pass your service code to Create rental or Create multi-service rental.
Request examples
Environment and dependencies. Each example encodes query values and allows 30 seconds for the request. Check HTTP and JSON status before using data. cURL prints the response for you to check; Java uses Jackson to read the JSON.
# Optional: add --data-urlencode "apikey=$SMSPVA_API_KEY" for account-specific data.
curl --get --fail-with-body --max-time 30 "https://smspva.com/api/rent.php" \
--data-urlencode "method=getdataWithProviders" \
--data-urlencode "country=KZ" \
--data-urlencode "dtype=week" \
--data-urlencode "dcount=1"Responses
Check the response that matches your request. Example values and dates are illustrative. Optional fields can depend on the outcome or the response format you selected.
HTTP 200
Success
application/json
Illustrative response
{
"status": 1,
"data": {
"services": [
{
"name": "1cupis & okcupid & winline",
"service": "opt48",
"price_day": 5,
"img": "images/ico/cupis_okcupid_winline.ico",
"procent_days": 0,
"procent": 0,
"day_step": 0,
"count": {
"Claro_AR": 27
},
"totalCount": 12
}
],
"totalAmount": 1735,
"allOperators": [
"Claro_AR"
]
}
}| Name | Type | Description |
|---|---|---|
status | integer | Status of the response: 1 for success, 0 for failure |
data | object | |
data.services | array<object> | |
data.services[].name | string | Service name |
data.services[].service | string | Service code Services list |
data.services[].price_day | number | Price per day for this service |
data.services[].img | string | Service icon URL |
data.services[].procent_days | integer | Number of days for discount |
data.services[].procent | integer | Discount percentage |
data.services[].day_step | integer | Day step for pricing |
data.services[].count | object | Number of available numbers for this service from each operator |
data.services[].count.* | integer | |
data.services[].totalCount | integer | Total count of available numbers for this service |
data.totalAmount | integer | Total count of available numbers for all services |
data.allOperators | array<string> | List of all available operators in this country |
msg | string | Error message when status is 0. The API may return HTTP 200 for this result. |