PHPackages                             tarikweiss/apple-maps-server-api-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. tarikweiss/apple-maps-server-api-client

ActiveLibrary[API Development](/categories/api)

tarikweiss/apple-maps-server-api-client
=======================================

A PHP-based reference-implementation for the Apple Maps Server API. Uses tweaks to enhance usage with PHP.

1.1.1(10mo ago)0109MITPHPPHP ^8.1

Since Feb 15Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/tarikweiss/apple-maps-server-api-client)[ Packagist](https://packagist.org/packages/tarikweiss/apple-maps-server-api-client)[ Docs](https://github.com/tarikweiss/https-github.com-tarikweiss-apple-maps-server-api-client)[ RSS](/packages/tarikweiss-apple-maps-server-api-client/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (8)Versions (4)Used By (0)

Apple Maps Server API Client
============================

[](#apple-maps-server-api-client)

Introduction
------------

[](#introduction)

A PHP-based reference-implementation for the [Apple Maps Server API](https://developer.apple.com/documentation/applemapsserverapi). It uses tweaks like mapping some types as enums, to bring comfort for using this library. This library supports version 1.2+ of Apple Maps Server API.

Prerequisites
-------------

[](#prerequisites)

- PHP 8.1+
- OpenSSL module installed and enabled
- PSR18 + PSR17 compatible http client

Installation
------------

[](#installation)

```
composer install tarikweiss/apple-maps-server-api-client
```

Usage
-----

[](#usage)

### Fast-Forward ⏩️

[](#fast-forward-️)

I have fulfilled all prerequisites, just show me the bare usage!

```
// This type of token source is for generated keys from the developer account.
$token = new \AppleMapsServerApiClient\Auth\InterimTokenSource('eyJra...')

// THis type of token source is for generating own auth token with private key.
$token = new \AppleMapsServerApiClient\Auth\PrivateKeyTokenSource(
    'JIHGFEDCBA',
    'ABCDEFGHIJ',
    file_get_contents('/file/to/private/key') // Alternatively you may use an OpenSSLAsymmetricKey object for example if you use a passphrase for your key.
);

$optionalPsr18ClientInstance = new \GuzzleHttp\Client();
$optionalPsr17RequestFactoryInstance = new \GuzzleHttp\Psr7\HttpFactory();

$client = new \AppleMapsServerApiClient\AppleMapsClient($token, $optionalPsr18ClientInstance, $optionalPsr17RequestFactoryInstance);

$geocodeQuery = new \AppleMapsServerApiClient\Query\GeocodeQuery('Markt Leipzig');
$geocodeQuery->lang = new \AppleMapsServerApiClient\Dto\Common\Lang('de-DE');

$placeResults = $client->geocode($geocodeQuery);
print_r($placeResults);
```

### Show me everything

[](#show-me-everything)

#### Key obtaining

[](#key-obtaining)

To use this client you have to obtain either a [Maps ID and a private key](https://developer.apple.com/documentation/applemapsserverapi/creating-a-maps-identifier-and-a-private-key) first.

Alternatively you may obtain a generated [token](https://developer.apple.com/documentation/MapKitJS/creating-a-maps-token), which is valid for 7 days, to experiment with the client. This should be used for development purposes only!

```
// Use of private key with identifier
$token = new \AppleMapsServerApiClient\Auth\PrivateKeyTokenSource(
    'JIHGFEDCBA',
    'ABCDEFGHIJ',
    file_get_contents('/file/to/private/key')
);
```

```
// Use of pre generated token
$token = new \AppleMapsServerApiClient\Auth\InterimTokenSource('eyJra...')
```

#### Usage of the client

[](#usage-of-the-client)

```
$optionalPsr18ClientInstance = new \GuzzleHttp\Client();
$optionalPsr17RequestFactoryInstance = new \GuzzleHttp\Psr7\HttpFactory();

$client = new \AppleMapsServerApiClient\AppleMapsClient($token, $optionalPsr18ClientInstance, $optionalPsr17RequestFactoryInstance);

$geocodeQuery = new \AppleMapsServerApiClient\Query\GeocodeQuery('Markt Leipzig');
$geocodeQuery->lang = new \AppleMapsServerApiClient\Dto\Common\Lang('de-DE');

$placeResults = $client->geocode($geocodeQuery);

print_r($placeResults);
```

#### HTTP Client

[](#http-client)

This library is using the `php/http-discovery` package to discover a default PSR18 + PSR17 compatible http client, if no client is given. You can explicitly set the client instance, as well as the request factory instance.

For more information, please take a look into the [php-http-discovery docs](https://docs.php-http.org/en/latest/discovery.html).

Resources
---------

[](#resources)

- [Developer Documentation Homepage](https://developer.apple.com/documentation/applemapsserverapi) of Apple Maps Server API
- [Create a Maps ID and a private key](https://developer.apple.com/documentation/applemapsserverapi/creating-a-maps-identifier-and-a-private-key) for production use
- [Create a pre generated token](https://developer.apple.com/documentation/MapKitJS/creating-a-maps-token) for development purposes
- [Configure http-discovery](https://docs.php-http.org/en/latest/discovery.html) to use a specific default http client

Contribution
------------

[](#contribution)

> Please have a look into the [Code of Conduct](CODE_OF_CONDUCT.md) before contributing.

- For filing bugs and features please use create an issue
- For fixing bugs or adding features feel free to create a pull-request.

### Docker

[](#docker)

You may use docker to get a right-configured `php` instance. There is also a `Makefile` for some handy commands, like updating `composer` dependencies, executing tests and making a static analysis.

You need `docker` with `compose` as plugin.

License
-------

[](#license)

This project is licensed unter [MIT](LICENSE.md) license.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance54

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~66 days

Total

3

Last Release

316d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b3b141fbbe51d892bf205dbd1b6b8901edbc65a6c9a8a5fbe2ca0505d29d342d?d=identicon)[tarikweiss](/maintainers/tarikweiss)

---

Top Contributors

[![tarikweiss](https://avatars.githubusercontent.com/u/6708551?v=4)](https://github.com/tarikweiss "tarikweiss (3 commits)")

---

Tags

api clientappleapple maps

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tarikweiss-apple-maps-server-api-client/health.svg)

```
[![Health](https://phpackages.com/badges/tarikweiss-apple-maps-server-api-client/health.svg)](https://phpackages.com/packages/tarikweiss-apple-maps-server-api-client)
```

###  Alternatives

[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

963.1M35](/packages/getbrevo-brevo-php)[swisnl/json-api-client

A PHP package for mapping remote JSON:API resources to Eloquent like models and collections.

211473.2k12](/packages/swisnl-json-api-client)[wordpress/php-ai-client

A provider agnostic PHP AI client SDK to communicate with any generative AI models of various capabilities using a uniform API.

26236.6k14](/packages/wordpress-php-ai-client)[smsapi/php-client

SMSAPI API PHP Client

652.1M17](/packages/smsapi-php-client)[smsapi.pl/php-client

SMSAPI API PHP Client

6581.4k1](/packages/smsapipl-php-client)[arbor-education/arbor-sdk-php

Arbor Education PHP SDK

116.8k](/packages/arbor-education-arbor-sdk-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
