Nhảy tới nội dung

Hướng dẫn nhà phát triển

Tài liệu hướng dẫn API

Hướng dẫn sử dụng dịch vụ API

Log in to the system

Tips

Getting started

Overview
  • An API key is required for requests to be processed by the system. Once a user registers, an API key is automatically generated for this user. The API key must be sent with each request (see full example below). If the API key is not sent or is expired, there will be an error. Please make sure to keep your API key secret to prevent abuse.

Rate Limit

  • Our API has a rate limiter to safeguard against spike in requests to maximize its stability. Our rate limiter is currently caped at 30 requests per 1 minute.
  • Several headers will be sent alongside the response and these can be examined to determine various information about the request.
X-RateLimit-Limit: 300
X-RateLimit-Remaining: 300
X-RateLimit-Reset: TIMESTAMP

Response Handling

  • All API response are returned in JSON format by default. To convert this into usable data, the appropriate function will need to be used according to the language. In Laravel, the function json_decode() can be used to convert the data to either an object (default) or an array (set the second parameter to true). It is very important to check the error key as that provides information on whether there was an error or not. You can also check the header code.
{
"error": 1,
"message": "An error occurred"
}

Check IP

IP Quality

Laravel
use Illuminate\Support\Facades\Http;

Http::timeout(1)->post("https://www.funnydev.vn/public_api/checkip",[
"api_key" => "string",
"ip" => "string",
"mode" => "string",
]);
Server response
{
"query": "127.0.0.1",
"status": true,
"recommend": true,
"trustable": {
"mobile": false,
"proxy": false,
"username": "sampleuser",
"total_server": 1,
"blacklist": 0%,
"fraud_score": 0,
}
"location": {
"continent": "Asia",
"continentCode": "AS",
"country": "Vietnam",
"countryCode": "VN",
"region": "13",
"regionName": "Tinh Quang Ninh",
"city": "Uong Bi",
"district": "",
"zip": "",
"lat": 21.0339,
"lon": 106.7634,
"ipapi_timezone": "Asia/Ho_Chi_Minh",
"maxmind_timezone": "Asia/Ho_Chi_Minh",
"offset": 25200,
"currency": "VND",
}
"dns": {
"isp": "Vietnam Internet Network Information Center",
"org": "",
"as": "AS18403 FPT Telecom Company",
"asname": "FPT-AS-AP",
}
}

Check Email

Email Validator

Server response
{
"query": "you@gmail.com",
"status": true
"recommend": true
"trustable": {
"exist": true,
"checkpoint": false,
"disposable": false,
"total_server": 1,
"blacklist": 0%,
"fraud_score": 0,
"suspicious": false,
"domain_type": "popular",
"domain_trust": true,
"username_trust": true,
"dns_valid": false,
}
}

Tổng kết