# Urbania Agency Profile API Documentation

Read the public profile of one agency or advertiser by id: name, logo, type, license and profile url, together with its current listings in the same item shape as /search. A page holds up to 30 listings. The id is the publisher id of any listing or the agent id of /listing. A page past the last page returns an empty list. An unknown agency is a non-billable 404.

- **Documentation:** [https://scrappa.co/docs/urbania-api/urbania_agency](https://scrappa.co/docs/urbania-api/urbania_agency)
- **API group:** Urbania API
- **Endpoint:** `GET https://scrappa.co/api/urbania/agency`

## 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 |
| --- | --- | --- | --- |
| `id` | integer | Yes | Agency id such as 1251411, taken from publisher.id of a search item. |
| `slug` | string | No | Optional agency slug from the profile url. It is cosmetic, so it can be left out. |
| `page` | integer | No | One-based page number. Defaults to 1. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/urbania/agency?id=1251411"
```

## Example response

```json
{
    "success": true,
    "data": {
        "agency": {
            "id": 1251411,
            "name": "MARTHANS GRUPO INMOBILIARIO",
            "url": "https://urbania.pe/inmobiliarias/marthans-grupo-inmobiliario_1251411-inmuebles.html",
            "type": "agency"
        },
        "items": [],
        "page": 1,
        "per_page": 30,
        "total": 43,
        "total_pages": 2,
        "has_more": true
    },
    "meta": {
        "endpoint_family": "agency",
        "billable": true
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A public parameter is missing or invalid, or the location cannot be resolved. The response is not billable. |
| 404 | Resource Not Found | The agency does not exist or has no listings. The response is not billable. |
| 503 | Unexpected Upstream Response | Urbania answered with a page in an unexpected format. The response is not billable. |
| 503 | Upstream Unavailable | Urbania was temporarily unavailable or blocked the request. The response is not billable and the request never answers 429. |

## 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)
