# Batdongsan Agent API Documentation

<p><strong>Batdongsan Agent API</strong> returns the profile of a publisher: name, photos, company, certificate number and expiry, awards, social links, how long the agent has been active, the number of listings and the views of the last 30 days.</p><p>Good to know:</p><ul><li>Take <code>agent_id</code> from <code>author.agent_id</code> in search and listing results or from the top agents route. A numeric author id is not accepted and returns 422.</li><li>The site offers no list of the listings of one agent, so this route returns only the listing count.</li><li>The phone number stays masked.</li></ul>

- **Documentation:** [https://scrappa.co/docs/batdongsan-api/batdongsan_agent](https://scrappa.co/docs/batdongsan-api/batdongsan_agent)
- **API group:** Batdongsan API
- **Endpoint:** `GET https://scrappa.co/api/batdongsan/agent`

## 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_id` | string | Yes | Profile id of the agent, for example 200810374fc3900f. |

## Example response

```json
{
    "data": {
        "id": 4752932,
        "name": "Th\u1ebf H\u00f9ng",
        "awards": [],
        "address": null,
        "company": {
            "name": null,
            "image_url": null
        },
        "socials": {
            "tiktok": null,
            "website": null,
            "youtube": null,
            "facebook": null
        },
        "agent_id": "thehung",
        "avatar_url": "https://file4.batdongsan.com.vn/2025/10/23/20251023103146-f33a.jpg",
        "certificate": {
            "number": "TQ-0305",
            "expires": "2029-07-25T00:00:00",
            "has_certificate": true
        },
        "description": null,
        "friendly_id": "thehung",
        "profile_url": "https://guru.batdongsan.com.vn/pa/thehung",
        "is_pro_agent": true,
        "phone_masked": "0985262***",
        "listing_count": 21,
        "cover_image_url": null,
        "highlighted_post": null,
        "social_image_url": "https://file4.batdongsan.com.vn/2026/04/28/20260428144634-27cc.jpg",
        "joined_duration_years": 1,
        "listing_views_last_30_days": 1257
    },
    "meta": {
        "billable": true,
        "endpoint_family": "agent"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A value is missing, unknown or out of range. Examples: an unknown province code, a category that does not exist for the listing type, or a reversed range. This response is not billed. |
| 404 | Not Found | The agent does not exist. This response is not billed. |
| 503 | Upstream Unavailable | Batdongsan could not be reached or returned data that does not match the request. Retry shortly. This response is not billed. |

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