PHPackages                             moldersmedia/lightspeedapi - 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. moldersmedia/lightspeedapi

ActiveLibrary[API Development](/categories/api)

moldersmedia/lightspeedapi
==========================

Provides a connection between your platform and the Lightspeed API

1.1.14(6y ago)0771MITPHPPHP &gt;=7.1.0

Since Dec 19Pushed 6y agoCompare

[ Source](https://github.com/moldersmedia/lightspeed-api-client)[ Packagist](https://packagist.org/packages/moldersmedia/lightspeedapi)[ RSS](/packages/moldersmedia-lightspeedapi/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (14)Used By (0)

Lightspeed API Client
=====================

[](#lightspeed-api-client)

This package is a re-build of the official Lightspeed API (also know as seoshop API). The official API is quite limited. Difference between this package and the official package are the following:

- Make it possible to let the request sleep when it fails when there are too many requests
- Calculate resource items without manually calculating everything over and over again
- Throwing different exceptions for API Call limit reached and SleepTime difference which includes the HTTP response
- Clearer error messages
- Splitted the resource classes from the WebshopappApiClient

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

[](#requirements)

- PHP 7.1 or greater (Required in composer.json)
- Guzzle HTTP client 6.\* or greater (Required in composer.json)

Install
-------

[](#install)

All you have to do is `composer require moldersmedia/lightspeedapi`

Official Lightspeed API compatibility
-------------------------------------

[](#official-lightspeed-api-compatibility)

The base of the API class is the official API. Replacing this package with the Lightspeed package works without conflicts (unless you've extended the official class). This package is a standalone and doesn't extend anything.

Using the ApiAclient
--------------------

[](#using-the-apiaclient)

You can construct the client by calling the class `MoldersMedia\LightspeedApi\Classes\Api\ApiClient`. The first parameter is the `$apiServer`, the second parameter is the `$apiKey` followed by the `$apiSecret` and the `$language`. The last parameter is the config which only accept an array. The array accepts the following array keys followed by their values:

```
$config = [
	'max_sleep_time'   => 5, 					// The maximum time that the sleep handler should wait. If the sleep time is
												// smaller then the next available request, an exception will be thrown

	'extra_sleep_time' => 'extraSleepTime', 	// This time will be added on the calculated sleep time.
												// Sleep time formula is (next available request time + extra_sleep_time). Max sleep time has nothing to do with this config

	// Below is the same Lightspeed API config as in the constructor and official Lightspeed API
	'cluster'          => 'apiServer',
	'language'         => 'apiLanguage',
	'user_secret'      => 'apiSecret',
	'api_key'          => 'apiKey'
];

```

Exception handling
------------------

[](#exception-handling)

There are 2 exceptions that will return the request data: `ApiClientException` and the `ApiLimitReachedException`. An clear error message will be given. For some more specific data you can use the following functions:

```
try {
	$api = ( new MoldersMedia\LightspeedApi\Classes\Api\ApiClient( 'eu', 'your_api_key', 'your_user_secret', 'nl' ) );

	$api->products->count();
} catch( MoldersMedia\LightspeedApi\Classes\Exceptions\General\ApiLimitReachedException $exception ) {
	$exception->getResource(); // Return the resource that thrown the exception if available. In this example 'products'
	$exception->getWaitTime(); // Time that the next API call can be made
	$exception->getMessage(); // Gives the error message
	$exception->getPayload(); // The GET or POST parameters that are given
}

```

### To-do

[](#to-do)

- Add resource names to all resource classes
- Cache some of the requests that wont change quite often (i.e. $api-&gt;languages-&gt;get() )
- Add a nice method to log errors. Should come in handy when using a queue worker
- Document the code
- Add data formatters to change array keys of the response easily
- Calculate hourly and daily rate

Contributing
------------

[](#contributing)

There are currently no code standards.

License
=======

[](#license)

This package is free for use. Selling the code is **not** allowed.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

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 ~57 days

Recently: every ~144 days

Total

13

Last Release

2423d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4244962?v=4)[Donny5300](/maintainers/Donny5300)[@Donny5300](https://github.com/Donny5300)

---

Top Contributors

[![Donny5300](https://avatars.githubusercontent.com/u/4244962?v=4)](https://github.com/Donny5300 "Donny5300 (21 commits)")

### Embed Badge

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

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

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k496.1k33](/packages/neuron-core-neuron-ai)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

528.3M7](/packages/avalara-avataxclient)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)[files.com/files-php-sdk

Files.com PHP SDK

2478.1k](/packages/filescom-files-php-sdk)[aimeos/prisma

A powerful PHP package for integrating media related Large Language Models (LLMs) into your applications

1942.4k4](/packages/aimeos-prisma)

PHPackages © 2026

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