Base URL: https://api.wxalerts.org
A photograph belongs to a spotter report. Every upload is screened before anyone else can see it, and until it has been cleared it is held and is not served. Sign-in rules, the CSRF header and the common errors are described at the top of Spotter reports.
| Limit | Value |
|---|---|
| Accepted formats | JPEG, PNG and WebP. HEIC must be converted first |
| Largest file | 12 MB |
| Largest picture | 50 million pixels |
| Photographs per report | 3 |
| Served copy | JPEG, longest edge 2048 px |
POST /spotter/reports/{ref}/photos
Signed in. Attach a photograph to a report. Allowed for the account that filed the report. The observer a relayed report names may also attach one, but only while a meteorologist’s open question on that report is waiting for a photo from them. The caller also needs a complete, unsuspended spotter profile, and that is checked before the file is read.
The body is multipart/form-data.
Parameters
| Name | In | Type | Required | Default | Bounds and values |
|---|---|---|---|---|---|
ref |
path | string | yes | the report’s public reference | |
file |
form, file | file | yes | JPEG, PNG or WebP, at most 12 MB | |
live_capture |
form | boolean | no | false | the shutter was pressed inside the report flow, not a gallery pick. A claim the client makes, and stored as one |
captured_at |
form | string | no | null | ISO 8601 with a time zone. What the phone’s clock said at the shutter. Read only when live_capture is true and the file has no usable camera metadata |
capture_lat, capture_lon |
form | number | no | null | where the phone was at the shutter. Same rule as captured_at |
capture_accuracy_m |
form | number | no | null | GPS accuracy in metres |
capture_heading_deg |
form | number | no | null | 0 to 360, the way the camera faced, from true north. Compared with the bearing to the event for tornado, funnel cloud, waterspout and wall cloud reports |
measurement |
form | string | no | null | JSON text, hail reports only. {"reference": [[x, y], [x, y]] or null, "stone": [[x, y], [x, y]]}, each coordinate a fraction from 0 to 1 of the upright image from its top left. The two points of a segment must differ |
Response
201 Created. The response carries no URL: whether a photograph can be reached
depends on it having been cleared, so a URL comes only from the listing route.
| Field | Type | Notes |
|---|---|---|
ref |
string | this photograph’s reference, used to withdraw it |
provenance |
string | what the camera’s own metadata says about the report: live, exif_matched, exif_missing or contradicted |
state |
string | quarantined while held, or published once cleared |
duplicate |
boolean | true when the same file was already on the report and nothing was added |
width, height |
integer | pixels |
measurement |
object or null | the overlay that was sent, if any |
{
"ref": "p4k9m2x7",
"provenance": "live",
"state": "quarantined",
"duplicate": false,
"width": 4032,
"height": 3024,
"measurement": null
}
Errors
| Status | Body | When |
|---|---|---|
403 |
{"detail": {"reason": "...", "missing": [...]}} |
the spotter profile is suspended, missing or incomplete |
404 |
{"detail": "No such report."} |
the report does not exist or is not yours to add to |
409 |
{"detail": "That report has been withdrawn."} or "That report was corrected. Add the photo to the current version." |
the report is retracted or superseded |
409 |
{"detail": "A report can carry 3 photographs. Remove one before adding another."} |
the limit is reached |
413 |
{"detail": "That photo is larger than 12 MB."} |
file too large |
422 |
{"detail": "<sentence>"} |
the file is empty, is not a readable image, is too large to process, is not JPEG, PNG or WebP, or the measurement is malformed. Also a measurement on a report that is not a hail report |
422 |
{"detail": "<sentence>"} |
the image was refused when it was screened. The message does not say why |
503 |
{"detail": "..."} |
photo storage is not available. Try again |
GET /spotter/reports/{ref}/photos
Anonymous for a public report. Lists the photographs on a report that have been
cleared. The same visibility rule as GET /spotter/reports/{ref} applies: a
restricted report, or any report while the public feed is switched off, answers
404 to everyone who is not on the inside of it.
Parameters
| Name | In | Type | Required |
|---|---|---|---|
ref |
path | string | yes |
Response
200 with an array of:
| Field | Type | Notes |
|---|---|---|
ref |
string | the photograph’s reference |
url |
string | a direct link on the site’s image domain |
width, height |
integer | pixels of the served copy |
state |
string | published |
provenance |
string | as above |
captured_at |
string or null | what the camera’s clock said. Not the report’s time and not to be shown as if it were |
measurement |
object or null | where on the picture a hail size was measured |
Errors
| Status | Body | When |
|---|---|---|
404 |
{"detail": "No such report."} |
no such report, or one you may not see |
DELETE /spotter/reports/{ref}/photos/{photo_ref}
Signed in. Withdraw a photograph. Unlike a withdrawn report, the file itself is deleted. Allowed for the account that filed the report.
Parameters
| Name | In | Type | Required |
|---|---|---|---|
ref |
path | string | yes |
photo_ref |
path | string | yes |
Response
204 No Content.
Errors
| Status | Body | When |
|---|---|---|
404 |
{"detail": "No such report."} |
not your report, or no such report |
404 |
{"detail": "No such photo."} |
no such photograph, or already removed |
409 |
as for upload | the report is retracted or superseded |
503 |
{"detail": "..."} |
photo storage is not available |