# LankaPropertyWeb Agent Directory API Documentation

Scrappa's `GET /api/lankapropertyweb/agents` lists the real estate agents and agencies of LankaPropertyWeb by service type.

## What you get

Each agent has `slug`, `id`, `name`, `url`, `verified`, `logo`, `services`, `areas_covered` and a short `description`. `id` is `null` when the site's slug has no number. Pass `slug` to `/api/lankapropertyweb/agent` for the profile and the listings.

## Service types

`agent_type` is `Sales` (default), `Rentals`, `Land`, `Commercial`, `Management` or `Research`. Other values return `422`.

## Pagination

`page` selects the page, 30 agents per page. `pagination` has `page`, `total_pages`, `returned` and `has_more`. A page past the last one returns an empty list with the real `page`. `total_pages` is `null` when the site shows a single page.

## Privacy

Phone numbers are never returned.

- **Documentation:** [https://scrappa.co/docs/lankapropertyweb-api/lankapropertyweb_agents](https://scrappa.co/docs/lankapropertyweb-api/lankapropertyweb_agents)
- **API group:** LankaPropertyWeb API
- **Endpoint:** `GET https://scrappa.co/api/lankapropertyweb/agents`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `agent_type` | string | No | Sales (default), Rentals, Land, Commercial, Management or Research. |
| `page` | integer | No | Result page, 30 agents per page. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/lankapropertyweb/agents?agent_type=Rentals"
```

## Example response

```json
{
    "success": true,
    "data": {
        "items": [
            {
                "slug": "shukraproperties--5645455",
                "id": 5645455,
                "name": "Shukraproperties",
                "url": "https://www.lankapropertyweb.com/agents/shukraproperties--5645455",
                "verified": true,
                "logo": "https://www.lankapropertyweb.com/images/pics/profiles/160976_1763090152_1435.jpeg",
                "services": [
                    "Residential sales",
                    "Rentals"
                ],
                "areas_covered": "Colombo 6",
                "description": "Apartments for rent & sale Colombo 1 Colombo 2 Colombo3 Colombo 4"
            }
        ],
        "pagination": {
            "page": 1,
            "total_pages": 3,
            "returned": 1,
            "has_more": true
        },
        "query": {
            "agent_type": "Rentals"
        }
    },
    "meta": {
        "endpoint_family": "agents",
        "billable": true
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A query parameter is missing, unknown or unusable. Unknown parameters and unknown values are rejected before any lookup, never ignored. Non-billable. |
| 503 | Upstream Unavailable | LankaPropertyWeb could not be reached after retries, answered with an error or changed its format (`UPSTREAM_UNAVAILABLE`). Retryable and never billed. Clients are never rate limited. |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
