PHPackages                             carlosafonso/emt-sdk-php - 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. carlosafonso/emt-sdk-php

ActiveLibrary

carlosafonso/emt-sdk-php
========================

Unofficial PHP SDK for Madrid's EMT OpenData API

v0.1.0(9y ago)225MITPHPPHP ~5.6|~7.0

Since Jan 3Pushed 7y ago1 watchersCompare

[ Source](https://github.com/carlosafonso/emt-sdk-php)[ Packagist](https://packagist.org/packages/carlosafonso/emt-sdk-php)[ Docs](https://github.com/carlosafonso/emt-sdk-php)[ RSS](/packages/carlosafonso-emt-sdk-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

emt-sdk-php
===========

[](#emt-sdk-php)

[![Latest Version on Packagist](https://camo.githubusercontent.com/09807893a389d0e0f7f17c562e1a49e53500d0d7e7c1f9a2b7469d8761a9cbd0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6361726c6f7361666f6e736f2f656d742d73646b2d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/carlosafonso/emt-sdk-php)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/b818f33d83dd78f997b6efbec817173cfa6669ce3a2d28e2a25e1124b31d7516/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6361726c6f7361666f6e736f2f656d742d73646b2d7068702f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/carlosafonso/emt-sdk-php)[![Coverage Status](https://camo.githubusercontent.com/f3234dc24881d1a118e79cce30e27bb2f3215ba59bab63712f81bb5e0f4ca02b/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6361726c6f7361666f6e736f2f656d742d73646b2d7068702e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/carlosafonso/emt-sdk-php/code-structure)[![Quality Score](https://camo.githubusercontent.com/2efc0bf8f96164bb274520f30ee7a7fa6accd1ac2e99e23fb2a44db7aad4fcb3/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6361726c6f7361666f6e736f2f656d742d73646b2d7068702e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/carlosafonso/emt-sdk-php)[![Total Downloads](https://camo.githubusercontent.com/822fb17ec6dfaf84014c97fc1a04244874bb5893faaab69a4b3fd24b573cad90/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6361726c6f7361666f6e736f2f656d742d73646b2d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/carlosafonso/emt-sdk-php)

An unofficial PHP SDK for Madrid's municipal bus company (EMT) OpenData API.

Install
-------

[](#install)

Via Composer

```
$ composer require carlosafonso/emt-sdk-php
```

Usage
-----

[](#usage)

You'll need a set of authentication credentials issued by the EMT OpenData team. These credentials can be obtained here: .

Create an instance of the SDK client passing the credentials described above:

```
$clientId = 'FOO.BAR.BAZ';
$passkey = 'ABCDEFGH-1234-ABCD-1234-ABCDEFGHIJKL'
$client = new Afonso\Emt\BusClient($clientId, $passkey);
```

Then call any of the available methods:

```
$data = $client->getRouteLines([123], new \DateTime());
print_r($data);
```

Which should output something like this (truncated for readability):

```
Array
(
    [0] => stdClass Object
        (
            [line] => 123
            [secDetail] => 10
            [orderDetail] => 1
            [node] => 1425
            [distance] => 0
            [distancePreviousStop] => 0
            [name] => PZA.DE LEGAZPI-MAESTRO ARBOS
            [latitude] => 40.390813555735
            [longitude] => -3.6951516754786
        )

    [1] => stdClass Object
        (
            [line] => 123
            [secDetail] => 10
            [orderDetail] => 1
            [node] => 930
            [distance] => 839
            [distancePreviousStop] => 839
            [name] => ANTONIO LOPEZ-AV.CORDOBA
            [latitude] => 40.386984182818
            [longitude] => -3.6982344337479
        )
)

```

Each web service has its own client implementation:

```
$busClient = new Afonso\Emt\BusClient($clientId, $passkey);
$geoClient = new Afonso\Emt\GeoClient($clientId, $passkey);

/* (additional clients are on the works) */
```

### Available methods

[](#available-methods)

The current version of this library exposes all API endpoints from the BUS web service ().

Additional services are expected to be implemented soon.

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Carlos Afonso](https://github.com/carlosafonso)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

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

Unknown

Total

1

Last Release

3412d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/298322ba620ba6518bce36e896723f1f771c4ee6257ab49548c45dcb06e2b9ce?d=identicon)[carlosafonso](/maintainers/carlosafonso)

---

Top Contributors

[![carlosafonso](https://avatars.githubusercontent.com/u/1700229?v=4)](https://github.com/carlosafonso "carlosafonso (28 commits)")

---

Tags

carlosafonsoemt-sdk-php

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/carlosafonso-emt-sdk-php/health.svg)

```
[![Health](https://phpackages.com/badges/carlosafonso-emt-sdk-php/health.svg)](https://phpackages.com/packages/carlosafonso-emt-sdk-php)
```

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k20](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)

PHPackages © 2026

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