Rental data
GET /api/rent.php?method=getdata
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 | "getdata" | Method name |
apikey | query | string | No | (optional) | Optional API key. When supplied, it may affect personalized rental data. |
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" | Set to 1 to include procent_days, procent and day_step pricing settings in each service entry. |
How to use this method
Look up service prices and available numbers for your country and rental duration. Set dtype to week or month, and dcount to the number of periods.
Service entries include names, codes, daily prices, counts and icon paths; data.totalAmount gives the total. Add extend=1 to include the pricing settings procent_days, procent and day_step. Check JSON status: 0 means the request failed, with details in msg, even if HTTP is 200.
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=getdata" \
--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": "Airbnb",
"service": "opt46",
"price_day": 6,
"count": 359,
"img": "images/ico/whatsapp.png",
"procent_days": 0,
"procent": 0,
"day_step": 0
}
],
"totalAmount": 100
}
}| 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 |
data.services[].count | integer | Available count |
data.services[].img | string | Service icon path. |
data.services[].procent_days | integer | Number of days for discount Returned with extend=1. |
data.services[].procent | integer | Discount percentage Returned with extend=1. |
data.services[].day_step | number | Day step for pricing Returned with extend=1. |
data.totalAmount | integer | Total count of available numbers for all services |
msg | string | Error message when status is 0. |