# የAPI ቁልፎችና የተፈቀዱ IP ዝርዝር

> የAfricaProxies API፦ ውስን የፈቃድ ወሰን ያላቸው API ቁልፎችና እስከ 10 የተፈቀዱ IP፣ proxy ያለ ይለፍ ቃል ለመጠቀም። የcurl፣ Python እና Node.js ምሳሌዎችን ያግኙ።

- URL: https://africaproxies.com/am/docs/api/api-keys/
- የመጨረሻው መዘመን: 2026-10-15
- አሳቢ: AfricaProxies (https://africaproxies.com)

ውስን የፈቃድ ወሰን ያላቸውን API ቁልፎች ይፍጠሩና ይሰርዙ፣ የተፈቀዱ IP ዝርዝርንም ያስተዳድሩ፤ እስከ 10 የምንጭ አድራሻዎች proxy-ዎችን ያለ ተጠቃሚ ስምና ይለፍ ቃል እንዲጠቀሙ ይፈቀዳል።

**በዚህ ገጽ ያሉ መዳረሻዎች**

- `GET /v1/api-keys`: የAPI ቁልፎችን ይዘርዝሩ
- `POST /v1/api-keys`: የAPI ቁልፍ ይፍጠሩ
- `DELETE /v1/api-keys/{keyId}`: የAPI ቁልፍ ይሰርዙ
- `GET /v1/ip-whitelist`: የተፈቀዱ IP ዝርዝርን ያሳዩ
- `POST /v1/ip-whitelist`: IP ወይም የአድራሻ ክልል በተፈቀዱት ዝርዝር ይጨምሩ
- `DELETE /v1/ip-whitelist/{entryId}`: ግቤትን ከተፈቀዱት ዝርዝር ያስወግዱ

መሠረታዊ URL `https://africaproxies.com/api/v1`። የመለያ ማረጋገጫ፣ ስህተቶችና ገደቦች፦ [የAPI አጠቃላይ መግለጫ](/am/docs/api/) ይመልከቱ።

## የAPI ቁልፎችን ይዘርዝሩ

`GET /v1/api-keys`

ማረጋገጫ፦ የAPI ቁልፍ በ`Authorization: Bearer API_KEY` ራስጌ ውስጥ።

**ምላሽ** `200 OK`

```json
{
  "data": [
    {
      "id": "key_5n2v8q",
      "name": "Rotation script",
      "prefix": "pk_4f9a2c",
      "scopes": [
        "read",
        "proxies"
      ],
      "createdAt": "2026-10-05T14:03:11Z",
      "lastUsedAt": null
    }
  ],
  "limit": 20
}
```

*curl*

```bash
curl -s "https://africaproxies.com/api/v1/api-keys" \
  -H "Authorization: Bearer $API_KEY"
```

*Python*

```python
import os
import requests

API = "https://africaproxies.com/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['API_KEY']}"}

r = requests.get(f"{API}/api-keys", headers=HEADERS, timeout=30)
r.raise_for_status()
print(r.json())
```

*Node.js*

```javascript
// Node.js 18+ (built-in fetch), ES module
const API = 'https://africaproxies.com/api/v1';

const res = await fetch(`${API}/api-keys`, {
  headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());
```

## የAPI ቁልፍ ይፍጠሩ

`POST /v1/api-keys`

ሙሉ `secret` አንድ ጊዜ ይመለሳል።

ማረጋገጫ፦ የAPI ቁልፍ በ`Authorization: Bearer API_KEY` ራስጌ ውስጥ።

**የጥያቄ አካል**

| መስክ | ዓይነት | አስፈላጊ | መግለጫ |
| --- | --- | --- | --- |
| `name` | string | አዎ | እስከ 60 ቁምፊዎች |
| `scopes` | array of `read` · `proxies` · `billing` | አዎ | — |

*ምሳሌ*

```json
{
  "name": "Rotation script",
  "scopes": [
    "read",
    "proxies"
  ]
}
```

**ምላሽ** `201 Created`

```json
{
  "id": "key_5n2v8q",
  "name": "Rotation script",
  "prefix": "pk_4f9a2c",
  "scopes": [
    "read",
    "proxies"
  ],
  "createdAt": "2026-10-05T14:03:11Z",
  "lastUsedAt": null,
  "secret": "pk_4f9a2c8e1b7d3f6a9c2e5b8d1f4a7c0e"
}
```

*curl*

```bash
curl -s -X POST "https://africaproxies.com/api/v1/api-keys" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Rotation script","scopes":["read","proxies"]}'
```

*Python*

```python
import os
import requests

API = "https://africaproxies.com/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['API_KEY']}"}

r = requests.post(f"{API}/api-keys", headers=HEADERS, json={"name": "Rotation script", "scopes": ["read", "proxies"]}, timeout=30)
r.raise_for_status()
print(r.json())
```

*Node.js*

```javascript
// Node.js 18+ (built-in fetch), ES module
const API = 'https://africaproxies.com/api/v1';

const res = await fetch(`${API}/api-keys`, {
  method: 'POST',
  headers: { Authorization: `Bearer ${process.env.API_KEY}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({ name: 'Rotation script', scopes: ['read', 'proxies'] }),
});
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());
```

## የAPI ቁልፍ ይሰርዙ

`DELETE /v1/api-keys/{keyId}`

ማረጋገጫ፦ የAPI ቁልፍ በ`Authorization: Bearer API_KEY` ራስጌ ውስጥ።

**ፓራሜትሮች**

| ስም | በ | ዓይነት | አስፈላጊ | መግለጫ |
| --- | --- | --- | --- | --- |
| `keyId` | path | string | አዎ | — |

**ምላሽ** `204 No Content`

ምንም አካል የለም፡ የሁኔታው ኮድ መልሱ ነው።

*curl*

```bash
curl -s -X DELETE "https://africaproxies.com/api/v1/api-keys/key_5n2v8q" \
  -H "Authorization: Bearer $API_KEY"
```

*Python*

```python
import os
import requests

API = "https://africaproxies.com/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['API_KEY']}"}

r = requests.delete(f"{API}/api-keys/key_5n2v8q", headers=HEADERS, timeout=30)
r.raise_for_status()
print(r.status_code)  # 204: done
```

*Node.js*

```javascript
// Node.js 18+ (built-in fetch), ES module
const API = 'https://africaproxies.com/api/v1';

const res = await fetch(`${API}/api-keys/key_5n2v8q`, {
  method: 'DELETE',
  headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(res.status); // 204: done
```

## የተፈቀዱ IP ዝርዝርን ያሳዩ

`GET /v1/ip-whitelist`

ማረጋገጫ፦ የAPI ቁልፍ በ`Authorization: Bearer API_KEY` ራስጌ ውስጥ።

**ምላሽ** `200 OK`

```json
{
  "data": [
    {
      "id": "ipw_8c1k2m",
      "cidr": "203.0.113.24",
      "label": "Office server",
      "createdAt": "2026-10-05T14:03:11Z"
    }
  ],
  "limit": 10
}
```

*curl*

```bash
curl -s "https://africaproxies.com/api/v1/ip-whitelist" \
  -H "Authorization: Bearer $API_KEY"
```

*Python*

```python
import os
import requests

API = "https://africaproxies.com/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['API_KEY']}"}

r = requests.get(f"{API}/ip-whitelist", headers=HEADERS, timeout=30)
r.raise_for_status()
print(r.json())
```

*Node.js*

```javascript
// Node.js 18+ (built-in fetch), ES module
const API = 'https://africaproxies.com/api/v1';

const res = await fetch(`${API}/ip-whitelist`, {
  headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());
```

## IP ወይም የአድራሻ ክልል በተፈቀዱት ዝርዝር ይጨምሩ

`POST /v1/ip-whitelist`

IPv4 አድራሻ፣ ከ /24 እስከ /32 ያለ IPv4 CIDR፣ IPv6 አድራሻ ወይም ከ /48 እስከ /128 ያለ IPv6 CIDR ይቀበላል። የግል፣ ወደ ራስ የሚመለሱና የተያዙ ክልሎች አይቀበሉም (`422`)። በመግቢያ መስመሩ በ60 ሰከንድ ውስጥ ይሠራል።

ማረጋገጫ፦ የAPI ቁልፍ በ`Authorization: Bearer API_KEY` ራስጌ ውስጥ።

**የጥያቄ አካል**

| መስክ | ዓይነት | አስፈላጊ | መግለጫ |
| --- | --- | --- | --- |
| `cidr` | string | አዎ | — |
| `label` | string | አይደለም | እስከ 60 ቁምፊዎች |

*ምሳሌ*

```json
{
  "cidr": "203.0.113.24",
  "label": "Office server"
}
```

**ምላሽ** `201 Created`

```json
{
  "id": "ipw_8c1k2m",
  "cidr": "203.0.113.24",
  "label": "Office server",
  "createdAt": "2026-10-05T14:03:11Z"
}
```

*curl*

```bash
curl -s -X POST "https://africaproxies.com/api/v1/ip-whitelist" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"cidr":"203.0.113.24","label":"Office server"}'
```

*Python*

```python
import os
import requests

API = "https://africaproxies.com/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['API_KEY']}"}

r = requests.post(f"{API}/ip-whitelist", headers=HEADERS, json={"cidr": "203.0.113.24", "label": "Office server"}, timeout=30)
r.raise_for_status()
print(r.json())
```

*Node.js*

```javascript
// Node.js 18+ (built-in fetch), ES module
const API = 'https://africaproxies.com/api/v1';

const res = await fetch(`${API}/ip-whitelist`, {
  method: 'POST',
  headers: { Authorization: `Bearer ${process.env.API_KEY}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({ cidr: '203.0.113.24', label: 'Office server' }),
});
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());
```

## ግቤትን ከተፈቀዱት ዝርዝር ያስወግዱ

`DELETE /v1/ip-whitelist/{entryId}`

ማረጋገጫ፦ የAPI ቁልፍ በ`Authorization: Bearer API_KEY` ራስጌ ውስጥ።

**ፓራሜትሮች**

| ስም | በ | ዓይነት | አስፈላጊ | መግለጫ |
| --- | --- | --- | --- | --- |
| `entryId` | path | string | አዎ | — |

**ምላሽ** `204 No Content`

ምንም አካል የለም፡ የሁኔታው ኮድ መልሱ ነው።

*curl*

```bash
curl -s -X DELETE "https://africaproxies.com/api/v1/ip-whitelist/ipw_8c1k2m" \
  -H "Authorization: Bearer $API_KEY"
```

*Python*

```python
import os
import requests

API = "https://africaproxies.com/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['API_KEY']}"}

r = requests.delete(f"{API}/ip-whitelist/ipw_8c1k2m", headers=HEADERS, timeout=30)
r.raise_for_status()
print(r.status_code)  # 204: done
```

*Node.js*

```javascript
// Node.js 18+ (built-in fetch), ES module
const API = 'https://africaproxies.com/api/v1';

const res = await fetch(`${API}/ip-whitelist/ipw_8c1k2m`, {
  method: 'DELETE',
  headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(res.status); // 204: done
```

---

AfricaProxies: AfricaProxies በሰሃራ በታች ላለው አፍሪካ የመኖሪያ IP proxy አቅራቢ ነው፤ ክፍያው በክሪፕቶ ነው፣ መታወቂያ መጫን አያስፈልግም።
