Blog ·

Official SDKs for five languages

Mapricot now has official libraries for JavaScript, Python, Ruby, PHP, and Go. Each one calls geocoding, places, routing, and IP geolocation, sends your key, and retries when the API is busy.

Language Install
JavaScript and Node.js npm install mapricot
Python pip install mapricot
Ruby bundle add mapricot-api
PHP composer require mapricot/mapricot
Go go get github.com/mapricothq/mapricot-go

Methods are grouped by product, the way the API's paths are, in each language's own style. In Python:

import os

from mapricot import Mapricot

client = Mapricot(os.environ["MAPRICOT_KEY"])
addresses = client.geocoding.search("128 SW 3rd Ave, Portland", limit=1)
coffee = client.places.nearby(45.52, -122.68, category="food:coffee_shop", radius=1000)

Responses are typed, too: TypeScript types for JavaScript, typed dicts in Python, and structs in Go. That includes the phone numbers, websites, and opening hours that places return.

In a web page, load the JavaScript client straight from jsDelivr with a browser key, which only works from your site's addresses. The JavaScript docs show it next to a MapLibre map. The source for each library is on GitHub.