Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ge-tracker/osrs-api
Interacts with the official OSRS API
https://github.com/ge-tracker/osrs-api
hiscores osrs osrs-api
Last synced: about 1 month ago
JSON representation
Interacts with the official OSRS API
- Host: GitHub
- URL: https://github.com/ge-tracker/osrs-api
- Owner: ge-tracker
- License: mit
- Created: 2020-05-01T11:28:06.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-03-06T12:05:51.000Z (almost 2 years ago)
- Last Synced: 2024-10-20T18:12:08.064Z (2 months ago)
- Topics: hiscores, osrs, osrs-api
- Language: PHP
- Size: 49.8 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# OSRS API
This package is a Laravel/PHP wrapper for the OSRS API, to easily interact with the Grand Exchange and Hiscore APIs.
## Installation
You can install the package via composer:
```bash
composer require ge-tracker/osrs-api
```If you wish to publish the package's configuration, you can run the following command:
```bash
php artisan vendor:publish --provider="GeTracker\OsrsApi\OsrsApiServiceProvider"
```## Usage
We recommend using this package via dependency injection in your methods, as this is a cleaner interface than a facade.
### Accessing the Grand Exchange API
``` php
public function execute(OsrsApi $osrsApi)
{
$item = $osrsApi->ge()->itemDetail(13576);
echo $item->id . ': ' . $item->name;
}
```### Fetching hiscores
All requests to the hiscores are cached for 60 seconds by default.
``` php
public function execute(OsrsApi $osrsApi)
{
$hiscores = $osrsApi->hiscores()->fetch('Lynx Titan');
echo 'Attack: ' . $hiscores->stats->attack->level;
}
```### Testing
``` bash
composer test
```### Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
### Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
## Credits
- [GE Tracker](https://github.com/ge-tracker)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
## Laravel Package Boilerplate
This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).