opensfhistory.org APIwww.opensfhistory.org ↗
Access geolocated historical San Francisco photographs from OpenSFHistory. Retrieve coordinates, dates, photographer credits, and collection metadata via 3 endpoints.
curl -X GET 'https://api.parse.bot/scraper/a27c5d27-17a2-455c-aaf2-cce506f24093/get_mapped_images' \ -H 'X-API-Key: $PARSE_API_KEY'
Get paginated list of all mapped historical images with their geographic coordinates. Optionally filter by a geographic bounding box. Returns image IDs, coordinates, and URLs for each image.
| Param | Type | Description |
|---|---|---|
| page | integer | Page number for pagination. |
| limit | integer | Number of results per page. Must be between 1 and 200. |
| max_lat | number | Maximum latitude for bounding box filter (e.g. 37.80). |
| max_lng | number | Maximum longitude for bounding box filter (e.g. -122.40). |
| min_lat | number | Minimum latitude for bounding box filter (e.g. 37.75). |
| min_lng | number | Minimum longitude for bounding box filter (e.g. -122.45). |
{
"type": "object",
"fields": {
"page": "integer",
"limit": "integer",
"total": "integer",
"images": "array of image objects with image_id, latitude, longitude, image_url, display_url",
"total_pages": "integer"
},
"sample": {
"page": 1,
"limit": 5,
"total": 717,
"images": [
{
"image_id": "wnp25.6699.jpg",
"latitude": 37.750027,
"image_url": "https://www.opensfhistory.org/Image/wnp25.6699.jpg",
"longitude": -122.427414,
"display_url": "https://www.opensfhistory.org/Display/wnp25.6699.jpg"
}
],
"total_pages": 144
}
}About the opensfhistory.org API
The OpenSFHistory API provides access to the OpenSFHistory map collection through 3 endpoints, returning geolocated historical photographs of San Francisco with coordinates, dates, photographer names, and collection metadata. The get_mapped_images endpoint supports bounding-box filtering so you can retrieve images scoped to a specific neighborhood or block, while get_image_details returns the full metadata record for any individual photograph.
What the API covers
All three endpoints draw from the OpenSFHistory mapped image collection — photographs that have been assigned geographic coordinates on the OpenSFHistory interactive map. Each image record carries a stable image_id (e.g. wnp32.3610.jpg), a latitude and longitude, an image_url for the full-resolution file, and a display_url for the preview version.
Browsing and filtering images
get_mapped_images returns a paginated list of all mapped images. You can page through results using the page and limit parameters (up to 200 per page) and narrow the result set to a geographic area using the four bounding-box parameters: min_lat, max_lat, min_lng, and max_lng. The response includes a total count and total_pages so you can drive your own pagination loop. Image IDs returned here feed directly into the other two endpoints.
Image metadata and location lookup
get_image_details accepts an image_id and returns the full metadata record: title, date, description, photographer, collection, and both image URL variants. get_images_at_location takes a precise latitude/longitude string and returns all images tagged to that exact coordinate, each with its title and image_id. Coordinates must match marker values from get_mapped_images — the matching is exact, not proximity-based.
Coverage notes
The dataset reflects OpenSFHistory's curated collection of San Francisco photographs. Only images that have been geographically mapped appear in results — unmapped items in the broader collection are not accessible through these endpoints. Date coverage spans the photographic history of the city, but the date field is a string and may contain ranges or approximate values as recorded in the original metadata.
- Build a neighborhood history map layer by querying
get_mapped_imageswith a bounding box for a specific SF district - Populate a timeline view of a city block by fetching
image_idvalues and resolvingdatefields fromget_image_details - Attribute photographer credits in a historical photo exhibit by reading the
photographerfield fromget_image_details - Cluster historical photos around a transit corridor using the
latitudeandlongitudefields fromget_mapped_images - Show all photos taken at a single corner or intersection using
get_images_at_locationwith exact coordinates - Cross-reference
collectionmetadata to identify which archive contributed a given photograph
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 250 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does OpenSFHistory have an official developer API?+
How does bounding-box filtering work in `get_mapped_images`?+
get_mapped_images accepts four optional parameters — min_lat, max_lat, min_lng, and max_lng — that define a geographic rectangle. Only images whose coordinates fall within that box are returned. Omitting all four parameters returns the full paginated dataset.Does `get_images_at_location` do proximity or radius-based matching?+
get_mapped_images results — for example, 37.327641 rather than a rounded value like 37.33. Passing an approximate coordinate will return zero results.Can I search for images by photographer name, date range, or keyword?+
get_mapped_images) or by exact coordinate (via get_images_at_location). Text-based fields like photographer, date, and description are returned in responses but cannot be used as query filters. You can fork this API on Parse and revise it to add a search endpoint that filters on those fields.