PHPackages                             filippo-toso/api-sdk - 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. filippo-toso/api-sdk

ActiveLibrary[API Development](/categories/api)

filippo-toso/api-sdk
====================

A lightweight SDK to develop REST API clients

v2.0.1(2y ago)01.3k13MITPHPPHP ^8.0 || ^9.0

Since Jan 14Pushed 2y ago1 watchersCompare

[ Source](https://github.com/filippotoso/api-sdk)[ Packagist](https://packagist.org/packages/filippo-toso/api-sdk)[ RSS](/packages/filippo-toso-api-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (6)Used By (3)

Api SDK
=======

[](#api-sdk)

A lightweight SDK to develop REST API clients

Installing
----------

[](#installing)

Use Composer to install it:

```
composer require filippo-toso/api-sdk

```

How does it work?
-----------------

[](#how-does-it-work)

The best way is to start with an example. Let's build an SDK for Windy.com APIs.

First we build the main class:

```
use FilippoToso\Api\Sdk\Sdk;

class Windy extends Sdk
{
    public function list(): ListEndpoint
    {
        return new ListEndpoint($this);
    }
}
```

The `Windy` exposes a `list()` method that implements the  calls. You can implement how many endpoints you want (i.e. `map`).

Then let's write the code to call the endpoint:

```
use FilippoToso\Api\Sdk\Endpoint;
use FilippoToso\Api\Sdk\Support\Response;

class ListEndpoint extends Endpoint
{
    public function nearby($latitude, $longitude, $radius = 10): Response
    {
        return $this->get('/list/nearby=' . $latitude . ',' . $longitude . ',' . $radius . '?' . http_build_query($this->params([
            'show' => 'webcams:location,image',
        ])));
    }
}
```

The ListEndpoint exposes the nearby() methods. An endpoint class can expose as many methods as you need (i.e. one for each REST call).

Finally, let's call the service:

```
use FilippoToso\Api\Sdk\Support\Options;

include(__DIR__ . '/../vendor/autoload.php');

include(__DIR__ . '/ListEndpoint.php');
include(__DIR__ . '/Windy.php');

$options = new Options([
    'uri' => 'https://api.windy.com/api/webcams/v2',
    'headers' => [
        'x-windy-key' => '...',
        'Content-Type' => 'application/json',
        'Accept' => 'application/json',
    ],
]);

$windy = new Windy($options);

$response = $windy->list()->nearby(45.9035644, 13.3038818, 10);

print_r($response->body());
```

The Options class allows you to specify multiple options (i.e. a production Vs. development url). Check the sources for more information on all the options available.

That's it. A flexible and clean implementation of an API SDK.

Source of inspiration
---------------------

[](#source-of-inspiration)

This SDK is heavily inspired by this article series:

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity67

Established project with proven stability

 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 ~90 days

Total

5

Last Release

852d ago

Major Versions

v1.0.2 → v2.0.02024-01-08

### Community

Maintainers

![](https://www.gravatar.com/avatar/55d89f2d44fb12225de2119994028ee69e36770bcf33c2b1ddf0d6672d28151b?d=identicon)[filippo.toso](/maintainers/filippo.toso)

---

Top Contributors

[![filippotoso](https://avatars.githubusercontent.com/u/26958813?v=4)](https://github.com/filippotoso "filippotoso (6 commits)")

### Embed Badge

![Health badge](/badges/filippo-toso-api-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/filippo-toso-api-sdk/health.svg)](https://phpackages.com/packages/filippo-toso-api-sdk)
```

###  Alternatives

[kbsali/redmine-api

Redmine API client

4221.1M24](/packages/kbsali-redmine-api)[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)[prokerala/astrology-sdk

Prokerala.com Astrology API Client Library for PHP.

2610.0k](/packages/prokerala-astrology-sdk)[luzrain/telegram-bot-api

PHP Wrapper for Telegram Bot API

1032.8k1](/packages/luzrain-telegram-bot-api)[bushlanov-dev/max-bot-api-client-php

Max Bot API Client library

281.6k](/packages/bushlanov-dev-max-bot-api-client-php)

PHPackages © 2026

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