Apple Map Server CLI
Interact with Apple Map Server APIs using the ams command-line tool.
Prerequisites
bash
ams version ams ping
Environment variables:
- •
AMS_MAPS_TOKEN(required) - •
AMS_BASE_URL(optional) - •
AMS_DEBUG=1(optional)
Authentication
bash
ams auth token ams auth token --raw ams auth token --json
When AMS_MAPS_TOKEN expires, generate a new Maps Token in the Apple Developer portal and update the environment variable.
Geocoding
bash
ams geocode "1 Infinite Loop, Cupertino, CA" ams geocode --json "1 Infinite Loop, Cupertino, CA" ams geocode --limit 3 "1 Infinite Loop, Cupertino, CA"
Reverse Geocoding
bash
ams reverse 37.3317,-122.0301 ams reverse 37.3317,-122.0301 --limit 3 ams reverse 37.3317,-122.0301 --json
Batch Geocode
bash
ams geocode --file queries.txt --limit 3 ams geocode --file queries.txt --json ams geocode --file queries.txt --concurrency 8
When --file is used with --json, output is JSONL (one object per input line).
Exit Codes
- •
0success - •
1runtime or API error - •
2usage error
Agent Best Practices
- •Always set
AMS_MAPS_TOKENand rotate it when expired. - •Use
--jsonfor machine-readable geocode results. - •Use
--limitand--concurrencyto control batch load. - •Use
AMS_BASE_URLwhen targeting non-default endpoints. - •Enable
AMS_DEBUG=1when diagnosing auth or token issues.