# Trulia Schools

Get assigned schools and their ratings for the area around a Trulia listing.

- **Documentation:** [https://scrappa.co/docs/trulia-api/trulia_schools](https://scrappa.co/docs/trulia-api/trulia_schools)
- **API group:** Trulia API
- **Endpoint:** `GET https://scrappa.co/api/trulia/schools`

## 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 |
| --- | --- | --- | --- |
| `url` | string | Yes | URL of the Trulia listing. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/trulia/schools?url=https%3A%2F%2Fwww.trulia.com%2Fhome%2F2-gary-ave-rehoboth-beach-de-19971-126520829"
```

## Example response

```json
{
    "data": {
        "schools": [
            {
                "name": "Beacon Middle School",
                "rating": 7,
                "url": "https://www.trulia.com/schools/DE-lewes-beacon_middle_school-180715"
            },
            {
                "name": "Cape Henlopen High School",
                "rating": 8,
                "url": "https://www.trulia.com/schools/DE-lewes-cape_henlopen_high_school-1524205"
            },
            {
                "name": "Rehoboth Elementary School",
                "rating": 8,
                "url": "https://www.trulia.com/schools/DE-rehoboth_beach-rehoboth_elementary_school-180674"
            }
        ],
        "count": 3
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A required parameter is missing or malformed. `url` must be a valid URL of at most 2048 characters (`id` on the listing-by-id endpoint must be an integer). Returned by the form request before any upstream request is made, and never billed. |
| 422 | Invalid Listing URL | The url is well formed but is not a canonical Trulia listing URL. `error.failure_type` is `invalid_url`. Non-billable, and no upstream request is made. |
| 503 | Upstream Unavailable | The upstream service is temporarily unavailable. Please 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)
