mirror of
https://github.com/Tizian-Maxime-Weigt/IP-to-ASN-and-Whois-API.git
synced 2026-08-20 13:40:38 +00:00
Update README.md
This commit is contained in:
@@ -1,2 +1,83 @@
|
|||||||
# IP-to-ASN-and-Whois
|
# IP-to-ASN Lookup API (fast hehe)
|
||||||
IP to ASN and Basic Whois with Country APi without Rate Limits
|
|
||||||
|
This API allows you to lookup the **ASN**, **country**, and **provider name** for a given IPv4 or IPv6 address.
|
||||||
|
|
||||||
|
## Base URL
|
||||||
|
|
||||||
|
```
|
||||||
|
https://cdn.t-w.dev/whois?ip={IP}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Request
|
||||||
|
|
||||||
|
### Method
|
||||||
|
|
||||||
|
* **GET** or **POST**
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
| ---- | ------ | -------- | ----------------------------- |
|
||||||
|
| ip | string | Yes | IPv4 or IPv6 address to query |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Response
|
||||||
|
|
||||||
|
### Success (200)
|
||||||
|
|
||||||
|
| Field | Type | Description |
|
||||||
|
| ----------- | ------ | ---------------------------------- |
|
||||||
|
| ip | string | The queried IP address |
|
||||||
|
| asn | string | Autonomous System Number |
|
||||||
|
| country | string | 2-letter country code of the ASN |
|
||||||
|
| description | string | Cleaned provider name (normalized) |
|
||||||
|
|
||||||
|
**Example:**
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ip": "8.8.8.8",
|
||||||
|
"asn": "15169",
|
||||||
|
"country": "US",
|
||||||
|
"description": "Google"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Error (400+)
|
||||||
|
|
||||||
|
| Field | Type | Description |
|
||||||
|
| ----- | ------ | -------------------------- |
|
||||||
|
| error | string | Description of the problem |
|
||||||
|
|
||||||
|
**Examples:**
|
||||||
|
|
||||||
|
```json
|
||||||
|
{ "error": "Missing 'ip' parameter" }
|
||||||
|
```
|
||||||
|
|
||||||
|
```json
|
||||||
|
{ "error": "Invalid IP address" }
|
||||||
|
```
|
||||||
|
|
||||||
|
```json
|
||||||
|
{ "error": "ASN not found for given IP" }
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## API Flow
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
flowchart TD
|
||||||
|
A[Client Request] --> B{IP parameter provided?}
|
||||||
|
B -- No --> C[Return Error: Missing 'ip' parameter]
|
||||||
|
B -- Yes --> D{IP valid?}
|
||||||
|
D -- No --> E[Return Error: Invalid IP address]
|
||||||
|
D -- Yes --> F[Lookup IP in ASN database]
|
||||||
|
F --> G{ASN found?}
|
||||||
|
G -- Yes --> H[Return JSON with ip, asn, country, description]
|
||||||
|
G -- No --> I[Return Error: ASN not found]
|
||||||
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user