Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cmandersen/mtg-api
A Magic the Gathering API (using Laravel)
https://github.com/cmandersen/mtg-api
Last synced: 11 days ago
JSON representation
A Magic the Gathering API (using Laravel)
- Host: GitHub
- URL: https://github.com/cmandersen/mtg-api
- Owner: cmandersen
- License: gpl-2.0
- Created: 2014-01-23T20:28:44.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-05-26T20:50:07.000Z (over 10 years ago)
- Last Synced: 2023-08-09T15:23:26.605Z (over 1 year ago)
- Language: PHP
- Homepage: http://api.cmandersen.net/mtg
- Size: 1.12 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Magic the Gathering API #
[![Build Status](https://travis-ci.org/cmandersen/mtg-api.png?branch=development)](https://travis-ci.org/cmandersen/mtg-api)
This is my version of a Magic the Gathering [REST](http://en.wikipedia.org/wiki/REST) API, utilizing [MTGJSON](http://mtgjson.com/) for the raw data and [MTGImage](http://mtgimage.com/) for links to the images.
As with all (actual) REST API's, if you add the id of an item to the url (.../api/v1/cards/1), you will get the item with that specific id.
## Getting the sets ##
**Link**: .../api/v1/sets
## Getting the cards of a set ##
**Link**: .../api/v1/sets/{id}/cards
### Options ###
| Param | Function | Accepts | Default |
| -------- | --------------------------------------------- |:----------:| ---------:|
| `limit` | Limits the number of items fetched | Integer | `50` |
| `offset` | Defines the index of where to start fetching | Integer | `0` |**Warning**: If you set the limit too high, you query will fail. The maximum limit varies from server to server.
## Getting the cards ##
**Link**: .../api/v1/cards
### Options ###
| Param | Function | Accepts | Default |
| -------- | --------------------------------------------- |:----------:| ---------:|
| `limit` | Limits the number of items fetched | Integer | `50` |
| `offset` | Defines the index of where to start fetching | Integer | `0` |
| `type` | The type of card to search for | String | `null` |
| `title` | A part of the name of the cards | String | `null` |
| `text` | A part of text on the cards | String | `null` |
| `colors` | The color of the cards to fetch | String | `null` |
| `rarity` | The rarity of the cards to fetch | String | `null` |**Warning**: If you set the limit too high, you query will fail. The maximum limit varies from server to server.
## Getting the planes ##
**Link**: .../api/v1/planes
### Options ###
| Param | Function | Accepts | Default |
| ------------ | --------------------------------------------- |:----------:| ---------:|
| `randomize` | Randomizes the order of the planes returned | Integer | `0` |