PHPackages                             deviantintegral/har - 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. deviantintegral/har

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

deviantintegral/har
===================

A PHP library for working with HTTP Archives

v1.1.0(3mo ago)1311.8k↑387.5%8[1 PRs](https://github.com/deviantintegral/har/pulls)GPL-2.0-or-laterPHPPHP ^8.2CI passing

Since Aug 21Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/deviantintegral/har)[ Packagist](https://packagist.org/packages/deviantintegral/har)[ RSS](/packages/deviantintegral-har/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (12)Versions (153)Used By (0)

HTTP Archive for PHP
====================

[](#http-archive-for-php)

[![CI](https://github.com/deviantintegral/har/actions/workflows/ci.yml/badge.svg)](https://github.com/deviantintegral/har/actions/workflows/ci.yml) [![Packagist](https://camo.githubusercontent.com/7a58ac3bed9ffb175c534e452abfb3fdac167be4bf627e677bf4772d02ffc39b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64657669616e74696e74656772616c2f6861723f7374796c653d666c61742d737175617265)](https://packagist.org/packages/deviantintegral/har)

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

[](#requirements)

- PHP 8.2+
- The `ext-json` extension.

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

[](#installation)

`composer require deviantintegral/har`, or [download the CLI tool](https://github.com/deviantintegral/har/releases).

Introduction
------------

[](#introduction)

This library supports reading and writing [HTTP Archive](http://www.softwareishard.com/blog/har-12-spec/) files. These archives are JSON objects containing one or more HTTP request and response pairs. In particular, this library is useful for taking HTTP requests exported from a browser's developer tools or with a proxy like [mitmproxy](https://mitmproxy.org) and using them as mocks in tests.

Features include:

- Reading a HAR into a fully-typed set of classes.
- Writing a `\Deviantintegral\Har\Har` back out into a HAR JSON string.
- Adapters for PSR-7 Request and Response interfaces.
- An interface and `\Deviantintegral\Har\HarRepository` class to load HARs from a filesystem or other backend.
- [A CLI tool](https://github.com/deviantintegral/har/releases) to split a HAR file into single files per request / response pair.

Example
-------

[](#example)

See [ReadmeTest.php](tests/src/Unit/ReadmeTest.php) for an example of how to use this library.

Optional values
---------------

[](#optional-values)

The HAR specification documents some fields as `-1` if they do not have a value. Other fields, like `comment`, may be omitted.

Fields that may be omitted will have a `has` method that should be called before calling `get`. For integer fields, the return value must be checked for `-1`.

Fidelity of Serialized and Deserialized data
--------------------------------------------

[](#fidelity-of-serialized-and-deserialized-data)

This library aims to preserve the actual JSON representation of loaded objects. However, in some cases, this is not possible. In particular, PHP only supports up to 6 digits in ISO 8601 timestamps, so any additional precision is lost. See [HarTest](tests/src/Unit/HarTest.php) for an example that checks the reading and writing of a HAR.

###  Health Score

60

—

FairBetter than 99% of packages

Maintenance82

Actively maintained with recent releases

Popularity35

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity89

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 54.4% 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 ~167 days

Recently: every ~8 days

Total

15

Last Release

118d ago

Major Versions

v0.7.2 → v1.0.02025-12-18

PHP version history (4 changes)0.1.0PHP ^7.2

0.2.0PHP ^7.3||^8.0

0.3.0PHP ^7.4||^8.0

v0.4.0PHP ^8.2

### Community

Maintainers

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

---

Top Contributors

[![deviantintegral](https://avatars.githubusercontent.com/u/255023?v=4)](https://github.com/deviantintegral "deviantintegral (215 commits)")[![claude](https://avatars.githubusercontent.com/u/81847?v=4)](https://github.com/claude "claude (98 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (80 commits)")[![beatchristen](https://avatars.githubusercontent.com/u/1488849?v=4)](https://github.com/beatchristen "beatchristen (2 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/deviantintegral-har/health.svg)

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[shopify/shopify-api

Shopify API Library for PHP

4634.8M16](/packages/shopify-shopify-api)[neos/flow-development-collection

Flow packages in a joined repository for pull requests.

144179.3k3](/packages/neos-flow-development-collection)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6939.5M343](/packages/drupal-core-recommended)[neos/flow

Flow Application Framework

862.0M451](/packages/neos-flow)[retailcrm/api-client-php

PHP client for RetailCRM API

68981.8k1](/packages/retailcrm-api-client-php)

PHPackages © 2026

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