PHPackages                             infogram/infogram - 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. infogram/infogram

ActiveLibrary[API Development](/categories/api)

infogram/infogram
=================

PHP client for infogr.am REST API

1.0.1(10y ago)1549.8k↓25%7[1 PRs](https://github.com/infogram/infogram-php/pulls)PHPPHP &gt;=5.3

Since Dec 12Pushed 4y ago21 watchersCompare

[ Source](https://github.com/infogram/infogram-php)[ Packagist](https://packagist.org/packages/infogram/infogram)[ Docs](https://github.com/infogram/infogram-php)[ RSS](/packages/infogram-infogram/feed)WikiDiscussions master Synced 1mo ago

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

\#Infogram-PHP

This library provides an API to create and update infographics on Infogr.am

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

[](#installation)

The recommended way to install Infogram-PHP is via [Composer](https://getcomposer.org/). Composer is a tool for dependency management in PHP. It allows you to declare the dependent libraries your project needs and it will install them in your project for you.

```
# Install Composer
curl -sS https://getcomposer.org/installer | php
```

Add the following dependency to the `require` section of your project's `composer.json`:

```
"require": {
  "infogram/infogram": "1.0.*"
}
```

Execute command line `composer update` in your project's root

### API Keys

[](#api-keys)

You're going to need API keys, the public key and the secret (or private) key, to be able to access infogr.am API service. To find your keys, log in to Infogr.am, find the [account settings](https://infogr.am/app/#/settings) on the left panel and look for the API credentials. Keep your secret key secret, don't send it to anyone and do not pass it to any service directly.

The public key is used to indentify the API account the code is accessing with and the secret key is used to sign every request, i.e., add additional parameter to the request query string or body.

Usage
-----

[](#usage)

### Making a Request

[](#making-a-request)

For making a request, two Infogram-PHP classes are essential: `Infogram\RequestSigningSession` and `Infogram\InfogramRequest`. The former is responsible for HTTP request signing using the provided API secret key and the latter performs HTTP requests to the Infogr.am API service.

TODO: add reference to HTTP API documentation

```
use Infogram\InfogramRequest;
use Infogram\RequestSigningSession;
//...
$consumerKey = 'Your public key';
$consumerSecret = 'Your secret key';
$session = new RequestSigningSession($consumerKey, $consumerSecret);
$request = new InfogramRequest($session, 'GET', 'themes');
$response = $request->execute();
```

### Using a Response

[](#using-a-response)

Method `Infogram\InfogramRequest::execute` returns an instance of class `Infogram\InfogramResponse` or `null` if Infogr.am API server cannot be accessed.

`Infogram\InfogramResponse` contains (1) HTTP status code from last API request, (2) HTTP response body, (3) HTTP response headers

```
$content = array(
  array(
    'type' => 'h1',
    'text' => 'hello'
  )
);
$session = new RequestSigningSession($consumerKey, $consumerSecret);
$request = new InfogramRequest($session, 'POST', 'infographics', array('content' => $content));
$response = $request->execute();
if (! $response) {
   die("Could not contact Infogr.am API server\n");
}
if (! $response->isOK()) {
   die('Error executing API request: ' . $response->getBody() . "\n");
}
echo 'Created new infographic with ID: ' . $response->getHeader('X-Infogram-Id') . "\n";
```

On successful request (`$response->isOK() == true`), response's method `getBody` returns either a string or array (converted from a JSON string) if applicable. On error (`! $response->isOK()`), `getBody` returns string which contains the error message if there is any.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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

Every ~226 days

Total

2

Last Release

3948d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/058b3e26cfcb49d784ef865fdb2951e54b854d5757a2dedab9559c77d744121f?d=identicon)[martinsb](/maintainers/martinsb)

---

Top Contributors

[![torbjon](https://avatars.githubusercontent.com/u/49188?v=4)](https://github.com/torbjon "torbjon (3 commits)")

---

Tags

infogram

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[razorpay/razorpay

Razorpay PHP Client Library

2024.8M44](/packages/razorpay-razorpay)[pubnub/pubnub

This is the official PubNub PHP SDK repository.

1314.6M17](/packages/pubnub-pubnub)[culqi/culqi-php

Cliente Culqi API para PHP

41356.8k1](/packages/culqi-culqi-php)[ahmadawais/sendy-php-api

Sendy PHP API Wrapper: Complete API interfacing.

8673.5k](/packages/ahmadawais-sendy-php-api)[epayco/epayco-php

Epayco API client for PHP

25187.2k3](/packages/epayco-epayco-php)[yunchuang/appstore-connect-api

sdk for appstore connect api

3865.3k](/packages/yunchuang-appstore-connect-api)

PHPackages © 2026

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