PHPackages                             alessiodh/postmanexporter - 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. alessiodh/postmanexporter

ActiveLibrary[API Development](/categories/api)

alessiodh/postmanexporter
=========================

Will create automatic postman collection based on guzzlehttp calls

02PHP

Since Nov 15Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Alessio-dh/PostmanExporter)[ Packagist](https://packagist.org/packages/alessiodh/postmanexporter)[ RSS](/packages/alessiodh-postmanexporter/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Postman extractor
=================

[](#postman-extractor)

A package to transform GuzzleHttp calls to a postman collection in code.

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

[](#installation)

This can be done through composer:

```
composer require alessiodh/postmanexporter

```

Usage
-----

[](#usage)

### Creating a new postman collection

[](#creating-a-new-postman-collection)

```
use Alessiodh\PostmanExporter\PostmanExporter;

$exporter = new PostmanExporter('My collection name');
```

### Adding Listeners for adding to call collection

[](#adding-listeners-for-adding-to-call-collection)

PostmanExporter provides 2 middleware handlers. The request middleware is required, this will automaticly document the request to the call collection. The response middleware is optional and will add the response to the request.

```
$middleware = new PostmanExporterMiddleware();
$stack = new HandlerStack();
$stack->setHandler(new CurlHandler());
$stack->push($middleware->documentRequest($exporter));
$stack->push($middleware->documentResponse($exporter));

$client = new Client(['handler' => $stack]);
```

When the handlers are added, every request executed with that specific client will be documented.

### Adding names and descriptions to calls

[](#adding-names-and-descriptions-to-calls)

`exporter_name` is the name that will be given to the call in postman this parameter is required to be provided or the call will not be registered. `exporter_description` is an optional parameter and will provide the description to the call.

```
$resp = $client->get('https://google.com?foo=bar&t=b',
    [
        'exporter_name' => 'Get test',
        'exporter_description' => 'Will perform a get request to google with 2 get parameters'
    ]
);
```

### Exporting results

[](#exporting-results)

To export the collection you can either export it as a json document that can be directly imported in postman or get the JSON returned as a string.

#### Export to JSON document

[](#export-to-json-document)

This function will write the file to `Storage::disk('public')` as a file named `postman.json`. It will not look if the file exists but instead will jsut overwrite it.

```
$exporter->exportToPostman();
```

#### Get JSON returned

[](#get-json-returned)

```
$exporter->getJsonOfCalls();
```

### Notice

[](#notice)

This is still a simple implementation of exporting calls to postman. Every contribution is welcome.

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/2d3a62f0de23c6323e8af2ff5a4f0b33cb37edae2e999f9ad40335b0ca7cd863?d=identicon)[Alessiodh](/maintainers/Alessiodh)

---

Top Contributors

[![Alessio-dh](https://avatars.githubusercontent.com/u/10885632?v=4)](https://github.com/Alessio-dh "Alessio-dh (3 commits)")

### Embed Badge

![Health badge](/badges/alessiodh-postmanexporter/health.svg)

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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