Astromark
Sign in
Astromark

Maps API

Place search, location and directions for every Xcojo product. JSON over HTTPS; browser calls are allowed from *.xcojo.com.

GET /api/places.php?q=coffee&lat=51.5072&lng=-0.1276

Search places. lat/lng are optional; without them the visitor’s city is used.

{"ok":true,"results":[{"name":"…","address":"…","lat":9.0,"lng":38.7,"category":"cafe","km":1.2,"source":"osm","url":"https://astromark.xcojo.com/?q=…"}]}

GET /api/geo.php

The visitor’s approximate location from their network (city level).

{"ok":true,"country":"GB","country_name":"United Kingdom","region":"England","city":"London","center":[9.01,38.76]}

GET /api/route.php?from=51.5072,-0.1276&to=51.5194,-0.1270&mode=driving

Directions. mode is driving, walking or cycling. Add &via=lat,lng|lat,lng for up to 8 stops. Up to two alternative routes are returned when there are no stops.

{"ok":true,"distance_km":3.4,"duration_min":9.5,"geometry":[[51.50,-0.12],…],"steps":[{"text":"Turn left onto …","distance":120,"location":[51.5,-0.12]}],"steps_text":["Turn left onto …"],"alternatives":[…]}

GET /api/place.php?lat=48.8584&lng=2.2945&name=Eiffel%20Tower

Place details: photos (Wikimedia Commons), a Wikipedia summary, current weather and what is nearby.

{"ok":true,"photos":[{"thumb":"…","url":"…","credit":"…","license":"CC BY-SA 4.0"}],"wiki":{"title":"…","extract":"…","url":"…"},"weather":{"temp_c":18,"text":"Partly cloudy"}}

GET /api/nearby.php?lat=48.8584&lng=2.2945&kind=cafe

Places of one kind near a point (OpenStreetMap). kind: cafe, restaurant, hotel, pharmacy, hospital, atm, bank, fuel, parking, supermarket, school, museum, attraction, bus, train.

{"ok":true,"results":[{"name":"…","lat":48.85,"lng":2.29,"km":0.2,"category":"cafe"}]}

GET https://astromark.xcojo.com/?q=Times%20Square&embed=1

Embed the map in an iframe on any *.xcojo.com page.

<iframe src="https://astromark.xcojo.com/?q=Times%20Square&embed=1" loading="lazy"></iframe>
Map data © OpenStreetMap contributors (ODbL). Show that credit wherever you display Astromark results.