PHPackages                             robsonsanches/stays-php-client - 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. robsonsanches/stays-php-client

ActiveLibrary[API Development](/categories/api)

robsonsanches/stays-php-client
==============================

PHP client for server-side integration with Stays API v1 (unofficial library)

v1.0.0(4y ago)14MITPHPPHP &gt;=7.3

Since Feb 20Pushed 4y ago1 watchersCompare

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

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

Stays API - PHP Client (Unofficial)
===================================

[](#stays-api---php-client-unofficial)

PHP client for server-side integration with Stays API v1 (unofficial library)

[![GitHub release (latest by date)](https://camo.githubusercontent.com/b668a736f408027cae673330fd6b5906bccf60d92bb1ce61ffc78952f11b9648/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f726f62736f6e73616e636865732f73746179732d7068702d636c69656e743f646973706c61795f6e616d653d746167)](https://camo.githubusercontent.com/b668a736f408027cae673330fd6b5906bccf60d92bb1ce61ffc78952f11b9648/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f726f62736f6e73616e636865732f73746179732d7068702d636c69656e743f646973706c61795f6e616d653d746167)[![GitHub](https://camo.githubusercontent.com/69316ee5dc4c0fa142759a8897bab52aaf8d7d0dbf580b068be3a6e5ee2e4197/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f726f62736f6e73616e636865732f73746179732d7068702d636c69656e74)](https://camo.githubusercontent.com/69316ee5dc4c0fa142759a8897bab52aaf8d7d0dbf580b068be3a6e5ee2e4197/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f726f62736f6e73616e636865732f73746179732d7068702d636c69656e74)

#### Table of contents:

[](#table-of-contents)

- [Requirements](#requirements)
- [Installation](#installation)
- [Getting started](#getting-started)
- [Setup](#setup)
- [Making Requests](#making-requests)
- [Using Responses](#using-responses)
- [Docs](#docs)
- [License](#license)
- [Release History](#release-history)

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

[](#requirements)

- PHP &gt;= 7.3
- Composer

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

[](#installation)

```
composer require robsonsanches/stays-php-client

```

Getting started
---------------

[](#getting-started)

To obtain API credentials please read the Stays API Docs .

Setup
-----

[](#setup)

Setup for the Stays API integration:

```
require '/vendor/autoload.php';

use RobsonSanches\Stays\Client\Client;

$stays = new Client($domain, $clientId, $clientSecret, $options);
```

### Client Parameters

[](#client-parameters)

ParameterTypeRequiredDescription`$domain``string`yesSystem's domain, example: `$clientId``string`yesAPI Client ID`$clientSecret``string`yesAPI Client Secret`$options``array`noAdditional options (see additional options table)#### Additional options

[](#additional-options)

OptionTypeRequiredDescription`type``string`noAPI type, default is `external``version``string`noAPI version, default is `v1``timeout``number`noRequest timeout, default is `2.0``response_format``string`noResponse format (`array`, `object` or `string`), default is `array``http_errors``bool`noSet to `false` to disable throwing exceptions, default is `true``http_client_options``array`noGuzzle HTTP client optionsMaking Requests
---------------

[](#making-requests)

You may use the get, post, patch, and delete methods to make requests to Stays API.

### Request Methods

[](#request-methods)

```
$stays->get($endpoint, $query = [], $headers = [])
$stays->post($endpoint, $data = [], $headers = [])
$stays->patch($endpoint, $data = [], $headers = [])
$stays->delete($endpoint, $query = [], $headers = [])
```

#### Arguments

[](#arguments)

ParameterTypeDescription`$endpoint``string`Stays API endpoint, example: `content/groups``$data``array`Only for POST and PATCH, data that will be converted to JSON`$query``array`Only for GET and DELETE, request query string`$headers``array`Additional http headersUsing Responses
---------------

[](#using-responses)

All the request methods will return a response that can be a *multidimensional array*, *array of objects* or *JSON string* on success. If is present the argument `http_errors = true`, will throwing `ClientException` error on failure.

```
use RobsonSanches\Stays\Client\ClientException;

try {
    $results = $stays->get('content/groups');
    print_r( $results, true ); // array or JSON string

} catch (ClientException $e) {
    echo $e->getMessage(); // Exception message.
}
```

To get the response data from Http Client:

```
$response = $stays->http()->getResponse();

echo $response->getReasonPhrase(); // Reason phrase (string).
echo $response->getStatusCode(); // Response code (int).
echo $response->getBody()->getContents(); // Response body (JSON).

print_r( $response->getHeaders() ); // Response headers (array).
print_r( $response->getBody() ); // PSR-7 StreamInterface (object).
```

If you need to get the last requested data:

```
$request = $stays->http()->getRequest();

echo $request->getUri(); // Requested URI (string).
echo $request->getMethod(); // Request method (string).
echo $request->getBody()->getContents(); // Request body content (JSON).

print_r( $request->getHeaders() ); // Request headers (array).
print_r( $request->getUri() ); // PSR-7 UriInterface (object).
print_r( $request->getBody() ); // PSR-7 StreamInterface (object).
```

Docs
----

[](#docs)

[Stays Documentation](https://stays.net/external-api/#introduction)

Licence
-------

[](#licence)

[The MIT License](https://github.com/robsonsanches/stays-php-client/blob/master/LICENSE)

Release History
---------------

[](#release-history)

- 2022-02-20 - 1.0.0 - Initial release.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

1546d ago

### Community

Maintainers

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

---

Tags

phpapiclientstays

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/robsonsanches-stays-php-client/health.svg)

```
[![Health](https://phpackages.com/badges/robsonsanches-stays-php-client/health.svg)](https://phpackages.com/packages/robsonsanches-stays-php-client)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[kunalvarma05/dropbox-php-sdk

Dropbox PHP API V2 SDK (Unofficial)

3633.0M18](/packages/kunalvarma05-dropbox-php-sdk)[resend/resend-php

Resend PHP library.

564.7M21](/packages/resend-resend-php)[mozex/anthropic-laravel

Anthropic PHP for Laravel is a supercharged PHP API client that allows you to interact with the Anthropic API

71226.4k1](/packages/mozex-anthropic-laravel)[picqer/sendcloud-php-client

A PHP Client for the SendCloud API

45400.4k1](/packages/picqer-sendcloud-php-client)[sima-land/api-php-client

Client library for Simaland APIs

311.5k](/packages/sima-land-api-php-client)

PHPackages © 2026

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