mtxserv / curse-api
PHP library for interacting with the CurseForge API.
Installs: 12
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 0
pkg:composer/mtxserv/curse-api
Requires
- php: ^7.0|^8.0|^8.1
- guzzlehttp/guzzle: ^7.0
README
Curse Api is a modern PHP library based on Guzzle for CurseForge.
Dependencies
- PHP 7
- Guzzle: ^7.0
Installation
Installation of Curse Api is only officially supported using Composer:
php composer.phar require mtxserv/curse-api
Example
<?php use CurseApi\CurseClient; use GuzzleHttp\Exception\GuzzleException; $client = new CurseClient([ 'api_key' => 'YOUR_API_KEY', // https://console.curseforge.com/?#/api-keys ]); try { // Get Games $response = $client->get('/v1/games'); $json = json_decode($response->getBody()->getContents(), \JSON_THROW_ON_ERROR); print_r($json); // Get All the Mods 7 $response = $client->get('/v1/games/mods/426926'); $json = json_decode($response->getBody()->getContents(), \JSON_THROW_ON_ERROR); print_r($json); // Get All the Mods 7 - Files $response = $client->get('/v1/games/mods/426926/files'); $json = json_decode($response->getBody()->getContents(), \JSON_THROW_ON_ERROR); print_r($json); } catch (GuzzleException $e) { echo $e->getMessage(); exit; }