PHPackages                             ifroariquemes/php-api - 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. ifroariquemes/php-api

ActiveLibrary[API Development](/categories/api)

ifroariquemes/php-api
=====================

Create a API for your PHP project in minutes

v0.1.0(9y ago)116MITPHP

Since Mar 21Pushed 9y ago1 watchersCompare

[ Source](https://github.com/ifroariquemes/PHP-API)[ Packagist](https://packagist.org/packages/ifroariquemes/php-api)[ Docs](https://github.com/ifroariquemes/php-api)[ RSS](/packages/ifroariquemes-php-api/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

PhpAPI
======

[](#phpapi)

Create a API for your PHP project in minutes. Simple add an annotation to yours methods and "voilá": it's done.

Usage
-----

[](#usage)

```
/**
 * @Api("my/route")
 * No @HttpMethod annotation, accepts all HTTP kinds of request methods
 */
public function myRoute() {
    // code
}

/**
 * @Api("route/with/$var")
 * @HttpMethod("PUT") // will accept only PUT requests
 */
public function routeWith($var) {
    // code
}

/**
 * @Api("another/$id/maybe/$var")
 * @HttpMethod("GET,POST") // will accept only GET and POST requests
 */
public function routeAnother($id, $var) {
    // code
}
```

As you can see, it uses a Symfony-like router to find the right code to execute. Moreover, it suports the use of patterns so some parts of request can be variables!

Just add a` $` inside **@Api** value to make it act as a method parameter.

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

[](#installation)

This library can be found on [Packagist](https://packagist.org/packages/ifroariquemes/php-api). We endorse that everything will work fine if you install this through `composer`.

Add in your `composer.json`:

```
{
    "require": {
        "ifroariquemes": "dev-master"
    }
}
```

or in your bash

```
$ composer require ifroariquemes/php-api
```

From any point, make available the following code to start:

```
require './vendor/autoload.php';
\PhpApi\PhpApi::start('src'); // your source code directory
```

If this script is available at  (suposing you already have a router working previously) then the API router will understand things starting there:

-
-
-

If you are not using a router, but created a new directory to keep our code, remember to enable `mod_rewrite` and have a file like this its root to get things done:

```
AddType application/x-httpd-php .php

RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ index.php [L]

Order Allow,Deny
Deny from all

```

This lib also uses a token system. You can activate it by creating a file named `keys.json` at API/project root folder:

```
{
    "SystemName": "token123456"
}
```

The client will use this token to communicate with the API by adding its value to the key `X-API-KEY` within the HTTP request header.

Docs &amp; Contribution
-----------------------

[](#docs--contribution)

You can also check the [docs/](docs/) for futher information about the classes and stuff. All codes are well commented so fell free to go deep and help us get this even better.

Profit!
-------

[](#profit)

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

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

3389d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1112479?v=4)[Natanael Simões](/maintainers/natanaelsimoes)[@natanaelsimoes](https://github.com/natanaelsimoes)

---

Tags

phpapirouting

### Embed Badge

![Health badge](/badges/ifroariquemes-php-api/health.svg)

```
[![Health](https://phpackages.com/badges/ifroariquemes-php-api/health.svg)](https://phpackages.com/packages/ifroariquemes-php-api)
```

###  Alternatives

[jstolpe/instagram-graph-api-php-sdk

Instagram Graph API PHP SDK

138110.7k2](/packages/jstolpe-instagram-graph-api-php-sdk)

PHPackages © 2026

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