The MEHDIE API gives read-only access to the public datasets on this site: their metadata, the places (or people) they contain, and searches over those records by name or location. No sign-in or key is needed. Suggestions are welcome through this form.
Each dataset has a numeric id and a short, unique label (e.g. KIMA-IL).
Every record has a MEHDIE place_id, unique across the site, and keeps the src_id it had
in its source dataset. Both stay stable as long as the dataset is on the site. The record URI is
https://tools.mehdie.org/api/place/<place_id>/.
People datasets (e.g. DiJeSt People) are stored like place datasets; their
records are served by the same endpoints. A dataset's datatype says which it is.
All responses are JSON. Place searches return a GeoJSON FeatureCollection in the
Linked Places format,
with every name variant of a record (in all its languages and scripts), its types, links, dates and
geometry.
An invalid request gets status 400 and a record or dataset that does not exist (or is not
public) gets 404, each with a JSON message, e.g. {"detail": "Parameter 'lat' must be a
number, got 'abc'."}
The same data, with the links MEHDIE found between records, is also available as RDF from the knowledge graph: see the SPARQL examples.
/api/datasets/ lists the public datasets with their metadata and record counts.
| parameter | value | notes |
|---|---|---|
| <none> | n/a | all public datasets |
| q | string | text in the dataset title or description |
| datatype | string | place or people |
| label | string | a single dataset by label |
| id | integer | a single dataset by id |
/api/datasets/<label>/ returns the metadata of one dataset.
/api/datasets/<label>/places/ lists every record in the dataset:
its id, src_id and title, ordered by id. Fetch a full
record with /api/place/<id>/.
Examples
All public datasets
Datasets from Kima, the historical Hebrew-script place-name database
Datasets of people rather than places
/api/datasets/?datatype=people
Metadata of the DiJeSt places dataset
Ids of all records in KIMA-IL
/api/db/ searches the records of all public datasets. Returns a
FeatureCollection; count is the total number of matches.
| parameter | value | notes |
|---|---|---|
| name | string | matches any name variant; exact matches first, then names starting with or containing it, then close spellings. Ignores case and accents. name, name_contains or id is required |
| name_contains | string | text in the record title |
| id | integer | a single record by place_id; other parameters are ignored |
| dataset | string | dataset label |
| fc | string | 1 or more GeoNames feature class letters, e.g. P,S |
| year | integer | within the record's attested timespan; negative for BCE |
| ccode | string | 1 or more 2-letter ISO country codes, comma separated |
| pagesize | integer | default 20, maximum 200 |
Examples
Jerusalem across all datasets, best matches first
Jerusalem in KIMA-IL only
/api/db/?name=jerusalem&dataset=KIMA-IL
KIMA-IL records with "forest" in the title
/api/db/?name_contains=forest&dataset=KIMA-IL
A single record by place_id
/api/place/<place_id>/ returns one full record, by its MEHDIE place_id.
/api/place/<label>/<src_id>/ returns the same record by the dataset label and the record's id in its source.
Besides names, types, links, dates and geometry, a record includes a small graph
(nodes, edges) of the records it is linked to: matches in other MEHDIE
datasets, external authorities such as Wikidata, and related places such as the region it lies in.
Examples
Jerusalem in the Himme dataset, by place_id
The same record by dataset label and src_id
/api/spatial/ finds records with point geometry near a location (nearby, nearest first) or inside a bounding box (bbox). Records without coordinates are not included. Returns a FeatureCollection.
| parameter | value | notes |
|---|---|---|
| type✳ | string | nearby or bbox |
| lon‡ | decimal deg. | longitude (WGS84) |
| lat‡ | decimal deg. | latitude (WGS84) |
| km‡ | number | search radius in km |
| sw† | lon,lat | southwest corner of the box |
| ne† | lon,lat | northeast corner of the box |
| dataset | string | dataset label |
| fc | string | 1 or more GeoNames feature class letters, e.g. P,S |
| pagesize | integer | default 20, maximum 200 |
✳ always required; ‡ required for nearby; † required for bbox
Examples
Records within 5 km of Jerusalem's Old City, nearest first
/api/spatial/?type=nearby&lon=35.2167&lat=31.7833&km=5
The same, KIMA-IL records within 10 km
/api/spatial/?type=nearby&lon=35.2167&lat=31.7833&km=10&dataset=KIMA-IL
Records in a box around Jerusalem