> ## Documentation Index
> Fetch the complete documentation index at: https://docs.visita.co.za/llms.txt
> Use this file to discover all available pages before exploring further.

# Directory API

> Search businesses and government entities

# Directory API

Access 60,000+ verified business and government entity listings across South Africa.

## Search Directory

```http theme={null}
GET /api/v1/directory
```

### Query Parameters

| Parameter   | Type   | Description                    |
| ----------- | ------ | ------------------------------ |
| `q`         | string | Search query (name, category)  |
| `ward_code` | string | Filter by ward                 |
| `category`  | string | Filter by category slug        |
| `type`      | string | `business` or `government`     |
| `limit`     | number | Results per page (default: 20) |

### Example Request

```bash theme={null}
curl -H "x-api-key: your_key" \
  "https://visita.co.za/api/v1/directory?q=clinic&ward_code=79700026"
```

### Example Response

```json theme={null}
{
  "success": true,
  "data": [
    {
      "id": "abc-123",
      "name": "Addington Hospital",
      "category": "Healthcare",
      "subcategory": "Hospital",
      "type": "government",
      "address": "123 Marine Parade, Durban",
      "phone": "+27 31 123 4567",
      "ward_code": "79700026",
      "location": {
        "lat": -29.8587,
        "lng": 31.0218
      }
    }
  ],
  "meta": {
    "total": 15,
    "limit": 20
  }
}
```

## Get Entity Details

```http theme={null}
GET /api/v1/directory/:slug
```

Returns full entity information including:

* Contact details
* Operating hours
* Categories
* Photos (if available)
* Reviews summary
