Checker API
irbots.com
Url : http://checker.irbots.com:2021
Endpoint: /check
Method: GET and POST
Request Parameters:
key(required): The API key for authentication purposes.numbers(required): A comma-separated list of phone numbers to be checked. The minimum number of phone numbers that can be checked is 1, and the maximum is 300.
Request Example (using GET method):
http://checker.irbots.com:2021/check?key=<your_api_key>&numbers=123456789,987654321
Request Example (using POST method with JSON payload):
json
{"key": "<your_api_key>", "numbers": "+123456789,+987654321"}
Response Parameters:
status: A string indicating the status of the request. Possible values areok,error, andspam.data: A dictionary containing the results of the phone number check.msg: A string containing an error message, if applicable.
Response Example:
json
{"data":{"+18563531813":true,"+447700150864":"error"},"status":"ok"}
در ادامه، چند مثال برای استفاده از API با استفاده از زبانهای مختلف شامل Python و PHP آورده شده است:
Python:
استفاده از کتابخانه requests برای ارسال درخواست به API و بازگرداندن پاسخ در قالب JSON.
import requests
url = "http://checker.irbots.com:2021/check"
api_key = "your_api_key"
phone_numbers = "123456789,987654321"
params = {
"key": api_key,
"numbers": phone_numbers
}
response = requests.get(url, params=params)
response_json = response.json()
print(response_json)
PHP:
استفاده از تابع curl برای ارسال درخواست به API و بازگرداندن پاسخ در قالب JSON.
$url = "http://checker.irbots.com:2021/check";
$api_key = "your_api_key";
$phone_numbers = "123456789,987654321";
$params = [
"key" => $api_key,
"numbers" => $phone_numbers
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url . "?" . http_build_query($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$response_json = json_decode($response, true);
print_r($response_json);