# OneRoof Agency API Documentation

<p><strong>OneRoof Agency API</strong> returns an agency (office) profile by numeric id: name, branch, address with coordinates, public phone, email and website, description, banner and counts of listings for sale, rent, sold and lease and of agents. Use the id with the search route (<code>office_id</code>) to list the agency's listings. An unknown id answers 404. Failed requests are not billed.</p>

- **Documentation:** [https://scrappa.co/docs/oneroof-api/oneroof_agency](https://scrappa.co/docs/oneroof-api/oneroof_agency)
- **API group:** OneRoof API
- **Endpoint:** `GET https://scrappa.co/api/oneroof/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 | Required. The numeric agency id (office.id) from a search item. |

## Example response

```json
{
    "data": {
        "id": 107,
        "name": "Bayleys Real Estate Ltd (Licensed: REAA 2008) - Bayleys, Remuera",
        "email": "office@example.co.nz",
        "phone": "+64 9 000 0000",
        "photo": "https://s.oneroof.co.nz/image/3b/29/3b291efc7b46be09a66f4c4058daf534.jpg?x-oss-process=image/quality,q_80",
        "banner": "https://s.oneroof.co.nz/image/9a/01/9a0168ca52acd05f60736ce7377d459f.jpg?x-oss-process=image/quality,q_80",
        "branch": "Bayleys",
        "counts": {
            "sold": 1826,
            "agents": 49,
            "for_rent": 0,
            "for_sale": 156,
            "for_lease": 0
        },
        "address": {
            "full": "303, Remuera Road, Remuera, Auckland",
            "region": "Auckland",
            "suburb": "Remuera",
            "district": "Auckland City",
            "latitude": -36.880517,
            "longitude": 174.795576
        },
        "website": "www.bayleys.co.nz",
        "description": "Bayleys Remuera is relocated at 303 Remuera Road, a state of the art, real estate office designed with one thing in mind \u2013 to provide the best possible environment for our business to provide exceptional service to our clients.\n\nLocated in the heart of the Remuera Village, this central location prov"
    },
    "meta": {
        "billable": true,
        "endpoint_family": "agency"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A parameter is missing or invalid. This response is not billable. |
| 404 | Not Found | The agency does not exist. This response is not billable. |
| 503 | Upstream Unavailable | OneRoof could not be reached. This response is not billable and is retryable. |

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