{"id":20655242,"url":"https://github.com/ericsizemore/api","last_synced_at":"2025-04-19T11:51:50.833Z","repository":{"id":221098885,"uuid":"753450399","full_name":"ericsizemore/api","owner":"ericsizemore","description":"A simple wrapper/builder using Guzzle for base API clients.","archived":false,"fork":false,"pushed_at":"2025-04-14T16:40:18.000Z","size":554,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-14T17:43:34.797Z","etag":null,"topics":["api","api-client","api-wrapper","guzzle","guzzlehttp","hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ericsizemore.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"ko_fi":"ericsizemore","github":"ericsizemore"}},"created_at":"2024-02-06T06:25:42.000Z","updated_at":"2025-04-14T16:39:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"773f9a1f-3d98-413b-b542-997802fd6d49","html_url":"https://github.com/ericsizemore/api","commit_stats":null,"previous_names":["ericsizemore/api"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericsizemore%2Fapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericsizemore%2Fapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericsizemore%2Fapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericsizemore%2Fapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericsizemore","download_url":"https://codeload.github.com/ericsizemore/api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249687880,"owners_count":21311122,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-client","api-wrapper","guzzle","guzzlehttp","hacktoberfest"],"created_at":"2024-11-16T18:09:39.906Z","updated_at":"2025-04-19T11:51:50.809Z","avatar_url":"https://github.com/ericsizemore.png","language":"PHP","funding_links":["https://ko-fi.com/ericsizemore","https://github.com/sponsors/ericsizemore"],"categories":[],"sub_categories":[],"readme":"Esi\\Api - A simple wrapper/builder using Guzzle for base API clients.\n=====================================================================\n\n[![Build Status](https://scrutinizer-ci.com/g/ericsizemore/api/badges/build.png?b=main)](https://scrutinizer-ci.com/g/ericsizemore/api/build-status/main)\n[![Code Coverage](https://scrutinizer-ci.com/g/ericsizemore/api/badges/coverage.png?b=main)](https://scrutinizer-ci.com/g/ericsizemore/api/?branch=main)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/ericsizemore/api/badges/quality-score.png?b=main)](https://scrutinizer-ci.com/g/ericsizemore/api/?branch=main)\n[![Continuous Integration](https://github.com/ericsizemore/api/actions/workflows/continuous-integration.yml/badge.svg?branch=main)](https://github.com/ericsizemore/api/actions/workflows/continuous-integration.yml)\n[![Latest Stable Version](https://img.shields.io/packagist/v/esi/api.svg)](https://packagist.org/packages/esi/api)\n[![Downloads per Month](https://img.shields.io/packagist/dm/esi/api.svg)](https://packagist.org/packages/esi/api)\n[![License](https://img.shields.io/packagist/l/esi/api.svg)](https://packagist.org/packages/esi/api)\n\n\n## About\n\nDocumentation will be a bit lackluster, and the unit tests need a lot of work. With that being said, I created this library more for use in my own projects that center around an API service; to decouple a lot of the logic that would be repeated in each API service library, to its own library.\n\nIt has a long way to go, but it should be relatively stable.\n\n## Features\n\n* Builds around [`guzzle/guzzle`](https://github.com/guzzle/guzzle) as the HTTP Client.\n* Cache's requests via [`Kevinrob/guzzle-cache-middleware`](https://github.com/Kevinrob/guzzle-cache-middleware).\n* Can retry requets on a connection or server error via the Guzzle Retry Middleware.\n  * `Client::enableRetryAttempts()` to instruct the client to attempt retries.\n  * `Client::disableRetryAttempts()` to disable attempt retries.\n  * `Client::setMaxRetryAttempts()` to set the maximum number of retries.\n* Can pass along headers in `Client::build()` to be 'persistent' headers, i.e. headers sent with every request.\n* One function that handles sending a request: `Client::send()`\n\nIt currently does not support async requests and pooling. Just your regular, good 'ol, standard requests.\n\n## Example\n```php\nuse Esi\\Api\\Client;\n\n// api url, api key, cache path, does the api require key sent as a query arg, the name of the query arg\n$client = new Client('https://myapiurl.com/api', 'myApiKey', '/var/tmp', true, 'api_key');\n\n// Must first 'build' the client with (optional) $options array which can include any valid Guzzle option.\n$client-\u003ebuild([\n    'persistentHeaders' =\u003e [\n        'Accept' =\u003e 'application/json',\n    ],\n    'allow_redirects' =\u003e true,\n    // ... etc.\n]);\n$client-\u003eenableRetryAttempts();\n$client-\u003esetMaxRetryAttempts(5);\n\n$response = $client-\u003esend('GET', '/', ['query' =\u003e ['foo' =\u003e 'bar']]);\n\n// Decode the json and return as array\n$data = $client-\u003etoArray($response);\n\n// or... as an object\n$data = $client-\u003etoObject($response);\n\n// or... for the raw json response, to do with as you will\n$data = $client-\u003eraw(); // or $response-\u003egetBody()-\u003egetContents()\n\n```\n\n### Requirements\n\n- PHP 8.2.0 or above.\n\n### Submitting bugs and feature requests\n\nBugs and feature requests are tracked on [GitHub](https://github.com/ericsizemore/api/issues)\n\nIssues are the quickest way to report a bug. If you find a bug or documentation error, please check the following first:\n\n* That there is not an Issue already open concerning the bug\n* That the issue has not already been addressed (within closed Issues, for example)\n\n### Contributing\n\nSee [CONTRIBUTING](CONTRIBUTING.md).\n\n### Author\n\nEric Sizemore - \u003cadmin@secondversion.com\u003e - \u003chttps://www.secondversion.com\u003e\n\n### License\n\nEsi\\Api is licensed under the MIT License - see the `LICENSE.md` file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericsizemore%2Fapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericsizemore%2Fapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericsizemore%2Fapi/lists"}