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

ActiveLibrary

improwised/api-helper
=====================

Laravel package to help consume REST and XML APIs with little effort.

0.1.31(5y ago)08MITPHPPHP &gt;=7.0.0

Since Apr 9Pushed 5y agoCompare

[ Source](https://github.com/Improwised/api-helper)[ Packagist](https://packagist.org/packages/improwised/api-helper)[ RSS](/packages/improwised-api-helper/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (5)Versions (38)Used By (0)

 [ ![Logo](https://camo.githubusercontent.com/ed478cfb884f851994bcdf8895a485efe53554a224a7b7c2f4b4c8a9cfcce8a0/68747470733a2f2f73746167696e672d6970726f6d6f74652e6c6465782e636f2f63746d2f4c44455f4c6f676f2d426c61636b2e706e67) ](https://www.localdataexchange.com)

### Api Helper Package

[](#api-helper-package)

 A package to consume api smoothly
 [**Explore the docs »**](#table-of-contents)

 [View Package](https://packagist.org/packages/improwised/api-helper) · [Report Bug](https://github.com/Improwised/api-helper/issues) · [Request Feature](https://github.com/Improwised/api-helper/issues)

Table of Contents
-----------------

[](#table-of-contents)

- [Getting Started](#getting-started)
- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
    - [Methods](#methods)
- [Response](#response)

Getting Started
---------------

[](#getting-started)

This package is useful to consume API's, here is the instruction for installation and usage.

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

[](#installation)

1. To install this package using [Packagist](https://packagist.org/packages/improwised/api-helper)
2. On the root of your project run following command

    ```
     composer require improwised/api-helper

    ```
3. This command will install package with dependency

Configuration
-------------

[](#configuration)

- To use this apihelper need to export config file to do so run the following command in your terminal to publish config file to config folder.

    ```
      php artisan vendor:publish  --provider="Improwised\ApiHelper\ApiHelperServiceProvider"

    ```
- This will publish config file naming **api\_helper.php** into config folder.

Prometheus Configuration
------------------------

[](#prometheus-configuration)

- Prometheus is dependent on your app so you need to provide prometheus configuration and also use below packages on your app.

    - [jimdo/prometheus\_client\_php](https://github.com/Jimdo/prometheus_client_php)
    - [superbalist/laravel-prometheus-exporter](https://github.com/Superbalist/laravel-prometheus-exporter)
- If you want to use prometheus then you should turn it on from config [api\_helper](src/Config/api_helper.php)

```
'log_stats' => true, // If you want to use prometheus then set as true otherwise false

    'prometheus' => [
        'labels' => [
            'client_id' => 10,
            'app' => 'api-helper',
            'source' => 'core',
        ],
        'histogram_bucket' => [0.1, 0.25, 0.5, 0.75, 1.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 7.5, 10.0],
    ],
```

- You can configure labels of prometheus inside `prometheus.labels` as per your need.
- `histogram_bucket` you can set inside prometheus config as array.

Usage
-----

[](#usage)

- To use this package you need to add following class where you want to use this package.

    ```
      use Improwised\ApiHelper\ApiBuilder;

    ```

### Methods

[](#methods)

#### addHeaders($headers)

[](#addheadersheaders)

- This method is use to add headers.
- It accept name and value as parameter, Here you can set only one header at a time.

    ```
      $headers['Accept'] = "application/json";
      $headers['Content-Type'] = "application/json";
      app(ApiBuilder::class)->addHeaders($headers);

    ```
- We will get response in form of object of ApiBuilder.

#### api($connection)

[](#apiconnection)

- This method is use to set api that we are going to use from *api\_helper.php* , there is httpbin and mokbin is define so you have to pass the name that you want to use.
- You can also define your own api end point at *api\_helper.php* in config file.

    ```
      app(ApiBuilder::class)->api('httpbin')->method_to_call();

    ```
- The snippet indicates how you can connect particular api and access their method.
- method\_to\_call() is the function that you have specified inside *api\_helper* connection array.
- This will return object of ApiResponse.

### Response

[](#response)

- Here you will get object in response, In each response you will get success either true or false
- You will also get status code for more information about response please check below doc.
-

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.1% 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 ~22 days

Recently: every ~68 days

Total

33

Last Release

1881d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d3cda0024a3df5de723a16e8f6681238b1146afd40cc41962ae96f44bd875f7a?d=identicon)[munir131](/maintainers/munir131)

![](https://www.gravatar.com/avatar/8152d98e435036ab2678fe55d3a83f6753fd0c8a3fb18b581dbea84719839d89?d=identicon)[improwised](/maintainers/improwised)

---

Top Contributors

[![aman00323](https://avatars.githubusercontent.com/u/48248836?v=4)](https://github.com/aman00323 "aman00323 (82 commits)")[![munir131](https://avatars.githubusercontent.com/u/6319375?v=4)](https://github.com/munir131 "munir131 (30 commits)")[![smitimprowised](https://avatars.githubusercontent.com/u/57352051?v=4)](https://github.com/smitimprowised "smitimprowised (6 commits)")[![vimal7016](https://avatars.githubusercontent.com/u/46291814?v=4)](https://github.com/vimal7016 "vimal7016 (3 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![deonvdv](https://avatars.githubusercontent.com/u/2487883?v=4)](https://github.com/deonvdv "deonvdv (1 commits)")[![tank-pooja](https://avatars.githubusercontent.com/u/62046605?v=4)](https://github.com/tank-pooja "tank-pooja (1 commits)")

---

Tags

laravel-apiLaravel Third Party Api CallApi Helperthird party callconsume api

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

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

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[specialtactics/laravel-api-boilerplate

An API boilerplate for Laravel

5451.5k](/packages/specialtactics-laravel-api-boilerplate)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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