# Zillow Property Photo

<p>Fetch one listing or building photo by its photo id and return it as a base64-encoded JPEG, with its content type and the address that was fetched. Use <a href="/docs/zillow-api/zillow_property">property details</a> or <a href="/docs/zillow-api/zillow_photos">the photo catalogue</a> to collect photo ids first.</p><h2>What a photo id is</h2><p>A photo id is the value the photo catalogue returns as <code>photo_id</code>, for example <code>afec6c0843ec505e58577c08457b50e4</code>. It is read as <code>/fp/{id}-{size}.jpg</code> on the photo CDN. The full <code>url</code> the catalogue returns is accepted too; only its path is used.</p><h2>Size</h2><p><code>size</code> defaults to <code>p_f</code>. The size is a token at the end of the file name: it is swapped where the id already carries one (<code>afec6c0843ec505e58577c08457b50e4-p_c.jpg</code> asked for as <code>p_w</code> becomes <code>afec6c0843ec505e58577c08457b50e4-p_w.jpg</code>) and appended where it does not. The returned <code>url</code> is the address that was actually fetched.</p>

- **Documentation:** [https://scrappa.co/docs/zillow-api/zillow_photo](https://scrappa.co/docs/zillow-api/zillow_photo)
- **API group:** Zillow API
- **Endpoint:** `GET https://scrappa.co/api/zillow/photo`

## 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 |
| --- | --- | --- | --- |
| `photo_id` | string | Yes | The photo id or media path from a property or building media link, as returned by the photo catalogue. |
| `size` | string | No | p_f (default, full), p_w, p_h, p_c or p_t. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/zillow/photo?photo_id=afec6c0843ec505e58577c08457b50e4&size=p_f"
```

## Example response

```json
{
    "data": {
        "photo_id": "<the photo id you sent>",
        "size": "p_f",
        "url": "<the media URL built from that id and size>",
        "content_type": "image/jpeg",
        "base64": "..."
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 400 | The request validation failed | A query parameter is missing, malformed, or outside its documented range. This is the only Zillow response that carries no error code: the body has a message and a field list and nothing else, so match it on the 400 status. |
| 422 | No research dataset matches that family and geography | The requested research file does not exist for the combination given. |
| 422 | More than one research dataset matches | The family, geography and variant given do not identify a single research file. |
| 422 | No accuracy figures are published for that region | The named state or metropolitan area publishes no estimate-accuracy data. |
| 422 | The upstream rejected the request | Zillow answered with a deterministic 4xx. |
| 422 | The building returned does not match the requested address | The decoded building token resolved to a building at a different address than the slug names. |
| 503 | The listing source answered with a block or rate-limit page | The request reached the source, but what came back was a challenge or rate-limit page rather than the data. |
| 503 | The listing source returned a server error | The request was served and answered with a 5xx. |
| 503 | The listing source did not answer in time | The request was sent and no answer came back before the deadline. |
| 503 | The request could not be sent | No approved exit could be reached, so the request never reached the listing source. |
| 503 | No approved exit is available | There was no usable approved exit to send the request through. |
| 503 | The upstream returned a document this integration cannot read | The publisher changed the shape of a response or served a document that is not the expected file. |

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