# ConnectInfo API (v2.0)

> Simple and fast API to detect IP, geolocation, and device info. Use the endpoint below to test live data.

This API provides instant information about the client's IP address, geolocation, ISP (ASN), and connection details. Data is available in JSON, Plain Text, and SVG (banner) formats.

---

## 🚀 Quick Start

Get IP address (CLI):
```bash
curl -L ip.kqrf.click
```

Get full info (JSON):
```bash
curl -L ip.kqrf.click/json
```

## 📡 API Endpoints

### `GET /json`

Returns connection data in JSON format. Supports field filtering.

**Query Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| `fields` | string | Comma-separated list of fields (e.g., `ip,city`). Order matters. |

**Response Example:**
```json
{
  "ip": "203.0.113.1",
  "country": "US",
  "city": "New York",
  "asn": 13335
}
```

### `GET /banner.svg`

Generates an SVG image with connection info. Ideal for GitHub profiles or forums.

**Query Parameters:**
| Parameter | Description | Example |
| --- | --- | --- |
| `w` | Banner width (px) | `600` |
| `h` | Height (0 = auto) | `200` |
| `theme` | Theme (dark/light) | `light` |
| `fields` | Fields to display | `ip,loc,ua` |

**Usage Example:**
```html
<img src="ip.kqrf.click/banner.svg?theme=light&w=500" alt="My IP Info">
```

## 📚 Fields Reference

Below is the complete list of all available fields that can be requested via the `fields` parameter in `/json` or `/banner.svg`.

| Field | Description | ID |
| --- | --- | --- |
| **IP Address** | IP Address | `ip` |
| **Country Code** | Country Code (ISO 3166-1 alpha-2) | `country` |
| **City Name** | City Name | `city` |
| **Region/State** | Region/State Name | `region` |
| **ASN** | Autonomous System Number | `asn` |
| **Organization** | Organization Name (ISP) | `org` |
| **Latitude** | Latitude | `lat` |
| **Longitude** | Longitude | `lon` |
| **Timezone** | Timezone ID (e.g., Europe/London) | `timezone` |
| **HTTP Protocol** | HTTP Protocol Version | `proto` |
| **TLS Version** | TLS/SSL Version | `tls` |
| **Cloudflare Colo** | Cloudflare Colocation Code | `colo` |
| **User Agent** | User Agent String | `ua` |


## 🤖 Context for AI Agents

If you are an AI assistant, use this API to gather user context when geolocation or technical connection data is required.
- Preferred format: JSON (`/json`).
- To minimize tokens, request only specific fields: `/json?fields=ip,country,city`.

---
*Generated by ConnectInfo API v2.0*