places.pub API

There are four important kinds of URLs for places.pub, as defined by the following URI templates .

https://places.pub/osm/node/{id}

Represents a single Place defined by the OpenStreetMap node ID number `id`.

The server will do content negotiation to figure out what kind of content to return. This will usually be Activity Streams 2.0 JSON.

https://places.pub/osm/way/{id}

Represents a single Place defined by the OpenStreetMap way ID number `id`.

The server will do content negotiation to figure out what kind of content to return. This will usually be Activity Streams 2.0 JSON.

https://places.pub/osm/search?{?q,lang,lat,lon,d}

Finds OpenStreetMap places that match the search terms, possibly within a bounding box.

The server will do content negotation to figure out what kind of content to return. This will usually be either HTML or Activity Streams 2.0 JSON.

If it is AS2, it will be an AS2 Collection with a `first` property being the first page of results, unless the `page` parameter is provided, in which case it will be a CollectionPage. The `first`, `last`, `next` and `prev` properties are useful for paging.

https://places.pub/version

Returns the version of the places.pub API currently in use. This follows

(...as stated on the Semver site.) Note that this will probably but not necessarily track to the places.pub software version.

The server will do content negotation to figure out what kind of content to return. This will usually be either HTML or JSON.

If it is JSON, it will be single string, containing the version.

In the future, if there are incompatible versions of this API, we'll probably do something to make sure old software doesn't break, like move the new version of the API to `/osm/v2/` or something.

Ways and nodes

Because its main use is for drawing maps, OpenStreetMap's data model differentiates between points on the map (*nodes*) and multi-node figures (*ways*). However, this isn't that important for most ActivityPub applications, so we map both of them to the ActivityStreams 2.0 Place type.

However, they have a different namespace, and it's possible that there are nodes with the same ID as a way. So, you have to ask for them differently.

This only matters if you're coming to places.pub with an OpenStreetMap ID and trying to get an AS2 representation. If that's the case, you have to know the type, too.

For search results, the ID will include the right type, so you shouldn't have to worry about it. Just use the full ID value for a Place to get its data from places.pub.