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

ActiveLibrary[API Development](/categories/api)

struktal/struktal-api
=====================

PHP library for creating consistent JSON APIs

1.0.0(10mo ago)01.5k↑284.6%1MITPHPPHP &gt;=8.2.0CI passing

Since Aug 21Pushed 10mo agoCompare

[ Source](https://github.com/Struktal/struktal-api)[ Packagist](https://packagist.org/packages/struktal/struktal-api)[ RSS](/packages/struktal-struktal-api/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (1)DependenciesVersions (2)Used By (1)

Struktal-API
============

[](#struktal-api)

This is a PHP library for creating consistent JSON APIs

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

[](#installation)

To install this library, include it in your project using Composer:

```
composer require struktal/struktal-api
```

Usage
-----

[](#usage)

You can send JSON responses using the methods in the `struktal\API\API` class. For example, to send any JSON response, you can use `API::sendJson`:

```
\struktal\API\API::sendJson([
    "field1" => "value1",
    "field2" => "value2"
]);
```

```
{
    "field1": "value1",
    "field2": "value2"
}
```

Alternatively, use the `API::sendWrappedJson` method to send a structured JSON response with a status code and message:

```
\struktal\API\API::sendWrappedJson([
    "field1" => "value1",
    "field2" => "value2"
], \struktal\API\HTTPResponse::OK);
```

```
{
    "code": 200,
    "message": "Ok",
    "data": {
        "field1": "value1",
        "field2": "value2"
    }
}
```

License
-------

[](#license)

This software is licensed under the MIT license. See the [LICENSE](LICENSE) file for more information.

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance54

Moderate activity, may be stable

Popularity20

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity49

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

317d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/49905418?v=4)[Jens Ostertag](/maintainers/JensOstertag)[@JensOstertag](https://github.com/JensOstertag)

---

Top Contributors

[![JensOstertag](https://avatars.githubusercontent.com/u/49905418?v=4)](https://github.com/JensOstertag "JensOstertag (1 commits)")

---

Tags

REST API

### Embed Badge

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

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

###  Alternatives

[airesvsg/acf-to-rest-api

Exposes Advanced Custom Fields Endpoints in the WordPress REST API

1.4k78.0k](/packages/airesvsg-acf-to-rest-api)[ronasit/laravel-swagger

Provided middleware for generating of swagger-documentation file by run testing of restful API.

180132.3k2](/packages/ronasit-laravel-swagger)[gdebrauwer/laravel-hateoas

Expose the authorization logic of your REST API using HATEOAS links on your Laravel API resources

174101.9k](/packages/gdebrauwer-laravel-hateoas)[rdoepner/cleverreach

CleverReach REST API v3 client

34332.9k](/packages/rdoepner-cleverreach)[grok-php/laravel

Seamlessly integrate Grok AI into Laravel applications with an elegant, developer-friendly package. Leverage powerful AI models for chat, automation, and NLP while maintaining Laravel's expressive simplicity.

1673.9k](/packages/grok-php-laravel)[shahghasiadil/laravel-api-versioning

Elegant attribute-based API versioning solution for Laravel applications with built-in deprecation management and version inheritance

2915.6k](/packages/shahghasiadil-laravel-api-versioning)

PHPackages © 2026

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