API · Reference
API documentation
One request per photo. Send an image and receive its location as JSON, usually within 20 to 40 seconds. The API uses embedded GPS coordinates when available. Otherwise WYSS TERRA LOCATOR estimates the location from the image and WYSS TERRA VERIFIER reviews the estimate.
Base URL: https://api.locate.photo/v1
Start
- 01 · AccountCreate an account at locate.photo and buy lookups. The API uses the same balance as the web app.
- 02 · KeyUnder Account → API keys, create a key. It is shown once; store it like a password.
- 03 · RequestSend a photo to POST /v1/locate with the key in the Authorization header.
Authentication
Send the key in every request, as a bearer token or in the x-api-key header. Keys begin with lp_live_. A revoked key is refused at once. Keep keys on your server; never put them into a web page or an app that others can download.
Authorization: Bearer lp_live_…
# or
x-api-key: lp_live_…Analyse a photo
POST /v1/locate
Send the photo in one of three ways. Accepted are JPEG, PNG and WebP up to 20 MB. A link must be a public http or https address that returns the image itself.
| Content type | Field | Meaning |
|---|---|---|
| multipart/form-data | image | The file. Optional field language: en or de. |
| application/json | image_url | Public address of the image. Optional field language. |
| application/json | image_base64 | The image as base64, with or without a data: prefix. Optional field language. |
language sets the language of clues, explanation and review: en (default) or de. It can also be given in the address: /v1/locate?language=de.
The deep analysis is currently available only in the web app (dashboard), not through the API. POST /v1/locate returns the analysis.
Response
| Field | Type | Meaning |
|---|---|---|
| country, region, city, district | string | null | The place, from coarse to fine. Fields that cannot be determined are null. |
| latitude, longitude | number | The estimated point (WGS 84). |
| radius_m | number | Search radius in metres around the point: the area to check. For an image analysis it is at least 150 m and always reaches the first estimate when LOCATOR and VERIFIER disagree; for a GPS result it is 50 m. |
| confidence | object | level: high, medium or low; score: 0 to 1. |
| clues[] | array | What in the photo points to the place: text, meaning, and box (position in the photo as fractions of width and height, 0 = left/top). |
| alternatives[] | array | Up to three other places the photo could show: place, latitude, longitude, probability, reason. Empty when the result is clear. |
| explanation | string | The reasoning of WYSS TERRA LOCATOR in full sentences. |
| review | object | The check by WYSS TERRA VERIFIER: verdict (confirmed, refined, rejected), distance_m between first estimate and final point, note. |
| source | string | gps_metadata when the photo contained a GPS position, image_content when the place was read from the image. |
| maps_url, share_url | string | Link to the point in Google Maps and a shareable result page. |
| id, duration_ms, credits_remaining | Result id (also in your history), duration of the analysis, lookups left. |
{
"id": "70f0fcbb-95b9-467b-b6b6-3cc4e346abd0",
"country": "Estonia",
"region": "Harju County",
"city": "Tallinn",
"district": "Raekoja plats",
"latitude": 59.4374,
"longitude": 24.7449,
"radius_m": 150,
"confidence": { "level": "high", "score": 0.951 },
"clues": [
{
"text": "Gothic town hall of grey limestone with arcades, battlements and clock",
"meaning": "This combination is characteristic of Tallinn Town Hall.",
"box": { "x0": 0.52, "y0": 0.22, "x1": 1, "y1": 0.7 }
}
],
"alternatives": [],
"explanation": "The building on the right with its arcade, battlements ...",
"review": { "by": "WYSS TERRA VERIFIER", "verdict": "confirmed", "distance_m": 32, "note": "..." },
"source": "image_content",
"maps_url": "https://www.google.com/maps/search/?api=1&query=59.4374,24.7449",
"share_url": "https://locate.photo/r/…",
"duration_ms": 20536,
"credits_remaining": 41
}Result types
| Case | What the response contains |
|---|---|
| source: gps_metadata | The file still had GPS coordinates. The point comes from them; radius_m is 50, clues and alternatives are empty, explanation says that the GPS data was used, and review has verdict, distance_m and note set to null. |
| source: image_content, verdict: confirmed | VERIFIER arrived at the same place. The point is VERIFIER's; distance_m is usually small. |
| source: image_content, verdict: refined | VERIFIER kept the place but moved the point, for example to the exact viewpoint. distance_m says by how much. |
| source: image_content, verdict: rejected | VERIFIER placed the photo elsewhere. Its point is returned, confidence is at most medium, and radius_m covers both estimates. The first estimate often appears in alternatives. |
| review: null | The review could not be completed. The first estimate is returned with a confidence of at most medium. |
Credits
Each successful analysis uses one lookup. If the analysis fails or the image cannot be analysed, the lookup is given back. Every result is also saved in your history in the web app, where you can open it, export it or download the case file as PDF. GET /v1/account returns the balance:
curl https://api.locate.photo/v1/account -H "Authorization: Bearer $LOCATE_API_KEY"
{ "key_name": "Newsroom server", "credits_remaining": 41 }Errors
Errors return a JSON object with error (a fixed code) and message (a readable sentence).
| Status | error | When |
|---|---|---|
| 400 | bad_image | No image, unreadable image, larger than 20 MB, or a link that cannot be fetched. |
| 401 | unauthorized | Key missing, invalid or revoked. |
| 402 | no_credits | No lookups left. Buy more on the pricing page. |
| 404 | not_found | Unknown path or method. |
| 415 | unsupported_type | Not a JPEG, PNG or WebP image. |
| 422 | not_analysable | The image cannot be analysed. No lookup is used. |
| 429 | rate_limited | More than 20 analyses in one minute with this key. Wait as given in Retry-After. |
| 500 / 502 | analysis_failed | The analysis failed. No lookup is used; try again. |
Limits
- 20 analyses per minute and key; at most 5 active keys per account.
- Images up to 20 MB; links are followed through at most 3 redirects.
- An analysis takes 20 to 40 seconds, rarely longer: set your client timeout to at least 120 seconds, better 300.
- Photos with people are analysed for the place only. The service must not be used to identify or track private individuals.
Samples
# A photo from disk
curl https://api.locate.photo/v1/locate \
-H "Authorization: Bearer $LOCATE_API_KEY" \
-F "image=@photo.jpg" \
-F "language=en"
# A photo on the web
curl https://api.locate.photo/v1/locate \
-H "Authorization: Bearer $LOCATE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"image_url": "https://example.com/photo.jpg"}'Need an invoice, a contract or a higher limit? Contact us