Score homes or H3 cells against your own rules, using our data. You define what matters in JSON: the checks, how much each one counts and which ones are must-haves. We then work out the result for every home or cell, and return every value, whether each check was met and your points.
Custom scores do not decide what makes a good place. There are no personas and no built-in model.
Each check reads one field from another dataset's row for the H3 cell (Proximity, Neighbourhood or Open spaces), so it is as up to date as that dataset. custom_scores.fields on /v1/catalog/{country} lists every field a check can read.
This page answers questions such as:
- Does this home have everything this buyer needs?
- Which parts of a country pass all of my must-haves?
- Which of my client's rules does this listing meet?
Required authentication header. Use the same application id as for the TravelTime API.
Required authentication header.
POST /v1/custom-scoresCheck a list of homes against a profile you define. The response has one row per home, in the order sent. There is no GET request, because the profile is sent as a JSON body.
| Parameter | Type · default | What it does | Example |
|---|---|---|---|
homes | [{id, lat, lng}] · — | 1 to 1,000 homes, all in the same country. id is your own identifier and is returned unchanged. | {"id": "listing-1", "lat": 51.5288, "lng": -0.1309} |
profile.checks | {key: check} · — | 1 to 50 checks, each keyed by a name of your choice. Each row returns the check under the same name. One profile per request. | "quiet": {"field": "neighbourhood.noise.max_lden_db", "max": 55, "weight": 2} |
Each check takes the following keys:
| Key | Type · default | What it does |
|---|---|---|
field | field · — | The field to read, named exactly as it appears in the rows, as <dataset>.<path in the row> (for example proximity.walk_s.supermarket). A field that is not listed in custom_scores.fields on /catalog returns a 400 error. |
min | number · — | The check is met when the value is at least this. |
max | number · — | The check is met when the value is at most this. Each check needs min, max or both. |
weight | whole number 1–1000 · — | The points given when the check is met. If you leave out every weight, the response shows only whether each check was met, with no score. |
must | true | false · false | Makes the check a must-have. If it fails, musts_met is false, and an area search leaves the H3 cell out. |
label | text · — | A label for your own UI. It is not returned. |
The endpoint also takes the Paging parameters limit and cursor in the body. A page has 100 rows by default. limit can be up to 10,000, or up to 100 when a check reads a proximity.bands. field.
Each row contains:
idcell: the resolution-9 H3 cell that contains the homechecks: keyed as you keyed them, each{met, value}, with the value in the field's own unit (seconds, dB, a count or a share)musts_metscore {points, out_of, share}: returned when any check has a weight, even when a must-have fails
A null value is never met. If the field's own row lists it in missing, the check also carries the reason given there (no_residents, over_900_s and so on).
| Code | HTTP | When |
|---|---|---|
invalid_homes | 400 | No homes are sent, more than 1,000 are sent, or a lat or lng is out of range. |
invalid_profile | 400 | The profile is outside one of the limits in the tables above. |
unknown_check_field | 400 | A field that no row contains. The message suggests the closest match when there is one, and allowed lists every field. |
out_of_coverage | 400 | A home is outside the countries we serve, or in a country that custom scores are not built for yet. param is homes. |
mixed_countries | 400 | The homes are in more than one country. Send each country's homes in a separate request. |
invalid_limit | 400 | limit is below 1 or over 10,000, or over 100 when a check reads a proximity.bands. field. |
| Any Paging error code | ||
This example sends a buyer's own list in JSON: what they need, how much each item matters, and one must-have. The Euston flat gets 8 of 10 points but is noisy (81.3 dB). The Milton Keynes house gets 2 of 10. It has two parks of 5 ha or more within 15 minutes, but the nearest supermarket is a 12-minute walk, there is one gym within 10 minutes and the transit rating is 21. Both homes pass the must-have (not in a flood zone). Every value is returned, so your app can show why each home scored as it did.
Request
curl -X POST -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" -H "Content-Type: application/json" \
-d '{
"homes": [
{"id": "listing-1", "lat": 51.5288, "lng": -0.1309},
{"id": "listing-2", "lat": 52.023, "lng": -0.77}
],
"profile": {
"checks": {
"supermarket": {"field": "proximity.walk_s.supermarket", "max": 600, "weight": 3, "label": "Supermarket in 10 min"},
"quiet": {"field": "neighbourhood.noise.max_lden_db", "max": 55, "weight": 2, "label": "Quiet street"},
"gyms": {"field": "proximity.bands.walk.600.category_counts.gym", "min": 3, "weight": 1, "label": "3+ gyms in 10 min"},
"no_flood": {"field": "neighbourhood.flood.zone", "max": 1, "must": true, "label": "Not in a flood zone"},
"transit": {"field": "proximity.ratings.transit", "min": 70, "weight": 2, "label": "Good public transport"},
"big_park": {"field": "proximity.bands.walk.900.over_5ha_count", "min": 1, "weight": 2, "label": "A park of 5+ ha in 15 min"}
}
}
}' \
"https://data.traveltimeapp.com/v1/custom-scores"Shade = checks.supermarket.value2377422 H3 cells; click a cell to open its row.
| H3 cellcell | Checks supermarket metchecks.supermarket.met | Checks supermarket valuechecks.supermarket.value | Checks quiet metchecks.quiet.met | Map |
|---|---|---|---|---|
| 89195da4d03ffff | met | 237 | not met | |
| 89195d88a97ffff | not met | 742 | not met |
All 2 shown
Response
{
"results": [
{
"id": "listing-1",
"cell": "89195da4d03ffff",
"checks": {
"supermarket": {
"met": true,
"value": 237
},
"quiet": {
"met": false,
"value": 81.3
},
"gyms": {
"met": true,
"value": 12
},
"no_flood": {
"met": true,
"value": 1
},
"transit": {
"met": true,
"value": 100
},
"big_park": {
"met": true,
"value": 1
}
},
"musts_met": true,
"score": {
"points": 8,
"out_of": 10,
"share": 0.8
}
},
"… 1 more row"
],
"next_cursor": null
}If you leave out the weights, each check returns only whether it was met, with its value, and the row has no score.
Request
curl -X POST -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" -H "Content-Type: application/json" \
-d '{
"homes": [{"id": "listing-1", "lat": 51.5288, "lng": -0.1309}],
"profile": {
"checks": {
"supermarket": {"field": "proximity.walk_s.supermarket", "max": 600, "label": "Supermarket in 10 min"},
"quiet": {"field": "neighbourhood.noise.max_lden_db", "max": 55, "label": "Quiet street"},
"gyms": {"field": "proximity.bands.walk.600.category_counts.gym", "min": 3, "label": "3+ gyms in 10 min"},
"no_flood": {"field": "neighbourhood.flood.zone", "max": 1, "label": "Not in a flood zone"},
"transit": {"field": "proximity.ratings.transit", "min": 70, "label": "Good public transport"}
}
}
}' \
"https://data.traveltimeapp.com/v1/custom-scores"Shade = checks.supermarket.value2372371 H3 cell; click it to open its row.
| H3 cellcell | Checks supermarket metchecks.supermarket.met | Checks supermarket valuechecks.supermarket.value | Checks quiet metchecks.quiet.met | Map |
|---|---|---|---|---|
| 89195da4d03ffff | met | 237 | not met |
All 1 shown
Response
{
"results": [
{
"id": "listing-1",
"cell": "89195da4d03ffff",
"checks": {
"supermarket": {
"met": true,
"value": 237
},
"quiet": {
"met": false,
"value": 81.3
},
"gyms": {
"met": true,
"value": 12
},
"no_flood": {
"met": true,
"value": 1
},
"transit": {
"met": true,
"value": 100
}
},
"musts_met": true
}
],
"next_cursor": null
}POST /v1/custom-scores/cellsUse the same profile to search for H3 cells.
An area search (near, bbox or country) returns only the H3 cells where every must-have is met, sorted by most points first, with ties broken by cell id. It stops at the top 10,000. next_cursor pages through them and is null at the end of the top 10,000.
With at or cells, every H3 cell you send is returned once, in the order sent, whether or not it meets the must-haves.
In a country that custom scores are not built for yet, a search returns no rows (matched 0).
| Parameter | Type · default | What it does | Example |
|---|---|---|---|
profile | {checks: …} · — | The same profile as for POST /v1/custom-scores (see above). | {"checks": {...}} |
The endpoint also takes the Location parameters (near, radius_m, bbox, cells, at, country) and the Paging parameters (limit, cursor) in the body. Send cells as a JSON list of resolution-9 H3 cells, or as compacted ids of any resolution up to 9, which are read as the res-9 cells inside them, up to 200,000.
Each row contains cell, checks, musts_met and score, as above, except that only a null value from a proximity field carries a reason.
The top level of the response contains:
matched: the H3 cells that pass every must-have. With no must-haves, this is every cell we hold data for in the area, or every cell sent withatorcellsreturned: the number of rows in all. For an area search, this is the smaller ofmatchedand 10,000. Withatorcells, it is the number of H3 cells sent
| Code | HTTP | When |
|---|---|---|
invalid_limit | 400 | limit is below 1 or over 10,000 (allowed_max 10000). |
invalid_profile | 400 | The profile is outside one of the limits in the tables above. |
unknown_check_field | 400 | A field that no row contains. The message suggests the closest match when there is one, and allowed lists every field. |
field_unindexed | 503 | The field is listed on /catalog, but this build cannot search H3 cells by it. You can still use it with POST /v1/custom-scores for a list of homes. |
| Any Location or Paging error code | ||
This runs the same rules as a search over the whole country. 326,487 H3 cells pass the must-have, so the response returns the top 10,000 by points, 100 a page.
Request
curl -X POST -H "X-Application-Id: YOUR_APP_ID" -H "X-Api-Key: YOUR_APP_KEY" -H "Content-Type: application/json" \
-d '{
"country": "gb",
"profile": {
"checks": {
"supermarket": {"field": "proximity.walk_s.supermarket", "max": 600, "weight": 3, "label": "Supermarket in 10 min"},
"quiet": {"field": "neighbourhood.noise.max_lden_db", "max": 55, "weight": 2, "label": "Quiet street"},
"gyms": {"field": "proximity.bands.walk.600.category_counts.gym", "min": 3, "weight": 1, "label": "3+ gyms in 10 min"},
"no_flood": {"field": "neighbourhood.flood.zone", "max": 1, "must": true, "label": "Not in a flood zone"},
"transit": {"field": "proximity.ratings.transit", "min": 70, "weight": 2, "label": "Good public transport"},
"big_park": {"field": "proximity.bands.walk.900.over_5ha_count", "min": 1, "weight": 2, "label": "A park of 5+ ha in 15 min"}
}
}
}' \
"https://data.traveltimeapp.com/v1/custom-scores/cells"Shade = checks.supermarket.value174592100 H3 cells; click a cell to open its row.
| H3 cellcell | Checks supermarket metchecks.supermarket.met | Checks supermarket valuechecks.supermarket.value | Checks quiet metchecks.quiet.met | Map |
|---|---|---|---|---|
| 891874ac393ffff | met | 387 | met | |
| 89194ad1d03ffff | met | 390 | met | |
| 89194e87387ffff | met | 336 | met | |
| 8919588542fffff | met | 386 | met | |
| 8919588c01bffff | met | 216 | met |
5 of the first 100 shown · next_cursor fetches the next page
Response
{
"matched": 326487,
"returned": 10000,
"results": [
{
"cell": "891874ac393ffff",
"checks": {
"supermarket": {
"met": true,
"value": 387
},
"quiet": {
"met": true,
"value": 54.38
},
"gyms": {
"met": true,
"value": 3
},
"no_flood": {
"met": true,
"value": 1
},
"transit": {
"met": true,
"value": 70
},
"big_park": {
"met": true,
"value": 2
}
},
"musts_met": true,
"score": {
"points": 10,
"out_of": 10,
"share": 1
}
},
"… 99 more rows"
],
"next_cursor": "eyJxIjoiZDQyNGVjYWM0NmVmZDQxZmYxMmNiOWE4IiwiayI6WzkuMCwiODkxOTA5YWM0NGJmZmZmIiwxMDBdLCJmIjoiZWMwNmU2MTYwZWE3MDdiZDk2ODllMGZlNTBhY2QwMDkifQ.jhsquKMv7YKFbunVp44kvA"
}