# Yaencontre Related Listings

Returns comparable listings for one reference. This path serves the whole related set in one response: the origin emits no totalItems, numPages or currentPage anywhere in the body and ignores paging, so num_pages is always 1, current_page is always 1, has_more is always false and exhausted is always true. meta.pagination.received reports how many cards actually came back. The example below is the recorded capture in tests/Fixtures/Yaencontre/related.json, which carried ten cards; one is shown for brevity.

- **Documentation:** [https://scrappa.co/docs/yaencontre-api/yaencontre_related](https://scrappa.co/docs/yaencontre-api/yaencontre_related)
- **API group:** Yaencontre API
- **Endpoint:** `GET https://scrappa.co/api/yaencontre/listing/related`

## 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 |
| --- | --- | --- | --- |
| `reference` | string | Yes | Listing reference from a search result. |
| `page_number` | integer | No | Must be 1. The origin returns the whole related set in one response and ignores paging here, so any other value is refused with a 422 before a lookup. |
| `page_size` | integer | No | Accepted for signature compatibility and not forwarded; the origin decides how many related cards come back. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/yaencontre/listing/related?reference=77267-112744273"
```

## Example response

```json
{
    "success": true,
    "data": {
        "total_items": 10,
        "num_pages": 1,
        "current_page": 1,
        "items": [
            {
                "reference": "39317-111124061",
                "title": "Piso en venta, Almendrales en Usera en Madrid",
                "price": 359000,
                "area": 118,
                "rooms": 5,
                "bathrooms": 2,
                "available": true,
                "advertiser_type": "agency"
            }
        ]
    },
    "meta": {
        "pagination": {
            "page": 1,
            "page_size": 50,
            "received": 10,
            "total": 10,
            "total_pages": 1,
            "has_more": false,
            "exhausted": true
        }
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 404 | Not Found | The requested listing reference does not exist. This response is not billable. |
| 422 | Validation Error | A public parameter is invalid, including rejected property types and transfer-only family pairings. This response is not billable and never reaches the origin. |
| 503 | Service Unavailable | The origin could not serve the request, or no usable network egress was available. This response is not billable; retry shortly. |

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