PHPackages                             sharadkashyap/php-api-response-toolkit - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. sharadkashyap/php-api-response-toolkit

ActiveLibrary[HTTP &amp; Networking](/categories/http)

sharadkashyap/php-api-response-toolkit
======================================

A lightweight, framework-independent PHP toolkit for consistent JSON API responses and error handling.

v0.1.1(1mo ago)02MITPHPPHP ^8.2CI passing

Since Jul 15Pushed 1mo agoCompare

[ Source](https://github.com/sharadkashyapdev/php-api-response-toolkit)[ Packagist](https://packagist.org/packages/sharadkashyap/php-api-response-toolkit)[ Docs](https://github.com/sharadkashyapdev/php-api-response-toolkit)[ RSS](/packages/sharadkashyap-php-api-response-toolkit/feed)WikiDiscussions main Synced 1w ago

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

PHP API Response Toolkit
========================

[](#php-api-response-toolkit)

[![PHP Version](https://camo.githubusercontent.com/83dd395020c37276225039739320f6c8e7e99963ab21ee3d09282cb48dad2a60/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d626c7565)](https://www.php.net/)[![License](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)](LICENSE)

A lightweight, framework-independent PHP library for creating consistent and standardized JSON API responses.

Purpose
-------

[](#purpose)

Provide a simple, reusable, and framework-independent way to generate consistent JSON API responses across PHP applications.

The goal of this library is to remove repetitive response formatting logic and provide a clean foundation for API development.

Features
--------

[](#features)

- Standard success responses
- Standard error responses
- Validation error responses
- HTTP status helpers
- Framework independent
- PSR-4 autoloading
- Lightweight and reusable
- Consistent JSON output structure

Requirements
------------

[](#requirements)

- PHP 8.1+

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

[](#installation)

Install using Composer:

```
composer require sharadkashyap/php-api-response-toolkit
```

Usage
-----

[](#usage)

### Success Response

[](#success-response)

```
