API Documentation for EchoMTG
Magic: the Gathering API for EchoMTG Collection Tools
About the EchoMTG API
This API returns JSON and is open to any EchoMTG user interested in writing custom scripts, apps, or integrations. The EchoMTG website and Mobile apps are 100% built on the API.
API Tokens
Attain a token by Registering an Echo user. Tokens expire after 24 hours. To have longer token life, join discord and ask for teeg about registering an app.
User
The majority of calls requires user authentication. Soon you will be able to create a user on the fly here as well. This will let you use EchoMTG's preexisting user base without creating your own.
POST Auth: Retrieving a User token
Authenticate a user to receive an access token which allows you to make API calls on behalf of the user. You will want to store the token to your application's memory or database for further use. A new token is generated every time a user is auth'd from anywhere. Tokens expire after 24 hours.
| Param | Required | Description |
|---|---|---|
| required | user email address | |
| password | required | user password |
| type | optional | Send curl to received a plain text token (no json) |
POST User: Change Currency
Changing currency will modify the values of all API output that involves a monetary value. The conversion rate is calculated from a daily pull from https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml
Available Currencies
- USD - U.S. Dollars
- GBP - British Pounds
- EUR - Euros
- AUD - Australian Dollars
- BRL - Brazilian Real
- CAD - Canadian Dollars
- CZK - Czech koruny
- DKK - Danish Kroner
- HKD - Hong Kong Dollars
- HUF - Hungarian Forints
- ILS - Israeli Shekels
- JPY - Japanese Yen
- MYR - Malaysian Ringgits
- MXN - Mexican Pesos
- NZD - New Zealand Dollars
- NOK - Norwegian Kroner
- PHP - Philippine Pesos
- PLN - Polish zloty
- SGD - Singapore Dollars
- SEK - Swedish Kronor
- CHF - Swiss Francs
- TWD - Taiwan New Dollars
- THB - Thai Baht
- TRY - Turkish Liras
POST Auth: Register User
Register a new user into the system.
| Param | Required | Description |
|---|---|---|
| required | user email address | |
| password | required | user password, must contain a letter and number |
| username | required | public handle |
| referrer | optional | referring hash of the user who invite. This can be found in user/meta call. |
Inventory
The most valuable part of EchoMTG is the inventory (collection) aspect. Being able to manipulate this from multiple application allows magic players to keep on top of their collections. This is a quick and easy way to add more value to your magic applications for users.
POST Inventory: Add an Item
Add a card to the user inventory.
| Param | Required | Default | Description |
|---|---|---|---|
| emid | required | EchoID | |
| quantity | optional | 1 | number to record |
| language | optional | EN | Card text language. See language options below |
| condition | optional | NM | Card condition, see options below |
| foil | optional | 0 | 1=foiled, 0=regular |
| image | optional | A remote URL to an uploaded image. To add an image through Echo, see the Upload Image endpoint |
Condition Options
NM = Near Mint
LP = Lightly Played
MP = Moderately Played
HP = Heavily Played
D = Damaged
ALT = Altered
ART = Artist Proof
PRE = Pre-release
TS = Timestamped
SGN = Signed
BGS = BGS
B10 = BGS 10
B95 = BGS 9.5
B9 = BGS 9.0
B85 = BGS 8.5
B8 = BGS 8.0
B75 = BGS 7.5
B7 = BGS 7.0
PSA = PSA
P10 = PSA 10
P95 = PSA 9.5
P9 = PSA 9.0
P85 = PSA 8.5
P8 = PSA 8.0
P75 = PSA 7.5
P7 = PSA 7.0
Language Options
EN = english
DE = german
FR = french
RU = russian
IT = italian
ES = spanish
PT = portuguese
CT = chinese traditional
CS = chinese simplified
JP = japanese
KR = korean
POST Inventory: Adding Items Batch
Add a card to the user inventory.
| Param | Required | Default | Description |
|---|---|---|---|
| emid | required | EchoID | |
| quantity | optional | 1 | number to record |
| language | optional | EN | Card text language. See language options below |
| condition | optional | NM | Card condition, see options below |
| foil | optional | 0 | 1=foiled, 0=regular |
| image | optional | A remote URL to an uploaded image. To add an image through Echo, see the Upload Image endpoint |
Condition Options
NM = Near Mint
LP = Lightly Played
MP = Moderately Played
HP = Heavily Played
D = Damaged
ALT = Altered
ART = Artist Proof
PRE = Pre-release
TS = Timestamped
SGN = Signed
BGS = BGS
B10 = BGS 10
B95 = BGS 9.5
B9 = BGS 9.0
B85 = BGS 8.5
B8 = BGS 8.0
B75 = BGS 7.5
B7 = BGS 7.0
PSA = PSA
P10 = PSA 10
P95 = PSA 9.5
P9 = PSA 9.0
P85 = PSA 8.5
P8 = PSA 8.0
P75 = PSA 7.5
P7 = PSA 7.0
Language Options
EN = english
DE = german
FR = french
RU = russian
IT = italian
ES = spanish
PT = portuguese
CT = chinese traditional
CS = chinese simplified
JP = japanese
KR = korean
POST Inventory: Update Item
Update an inventory item.
| Param | Required | Default | Description |
|---|---|---|---|
| id | required | Inventory ID | |
| quantity | optional | 1 | number to record |
| language | optional | EN | Card text language. See language options below |
| condition | optional | NM | Card condition, see options below |
| foil | optional | 0 | 1=foiled, 0=regular |
| image | optional | A remote URL to an uploaded image. To add an image through Echo, see the Upload Image endpoint |
Condition Options
NM = Near Mint
LP = Lightly Played
MP = Moderately Played
HP = Heavily Played
D = Damaged
ALT = Altered
ART = Artist Proof
PRE = Pre-release
TS = Timestamped
SGN = Signed
BGS = BGS
B10 = BGS 10
B95 = BGS 9.5
B9 = BGS 9.0
B85 = BGS 8.5
B8 = BGS 8.0
B75 = BGS 7.5
B7 = BGS 7.0
PSA = PSA
P10 = PSA 10
P95 = PSA 9.5
P9 = PSA 9.0
P85 = PSA 8.5
P8 = PSA 8.0
P75 = PSA 7.5
P7 = PSA 7.0
Language Options
EN = english
DE = german
FR = french
RU = russian
IT = italian
ES = spanish
PT = portuguese
CT = chinese traditional
CS = chinese simplified
JP = japanese
KR = korean
GET Inventory: View
View user inventory. All options can be combined.
Maximum limit is 1000.
Searches automatically limit to 1000 returned.
Meta data in return contains information for pagination.
| Param | Required | Default | Description |
|---|---|---|---|
| start | optional | 0 | |
| limit | optional | 100 | Number to records to return. Maximum 250 |
| sort | optional | date_acquired | price_acquired, date_acquired, name, set, price_change, tcg_market, tcg_mid, foil_price |
| direction | optional | ASC | Change sort direction |
| cmc | optional | A math equation like '<=1' or '=0' or '>=5' | |
| color | optional | colorless, blue, white, red, multicolor, black, green | |
| tradable | optional | true, false | |
| reserve_list | optional | true, false | |
| price_under | optional | float number, return any item worth less than number | |
| price_over | optional | float number, return any item worth more than number |
GET Inventory: Search
View user inventory. All options can be combined.
Maximum limit is 1000.
Searches automatically limit to 1000 returned.
Meta data in return contains information for pagination.
| Param | Required | Default | Description |
|---|---|---|---|
| start | optional | 0 | |
| limit | optional | 100 | Number to records to return. Maximum 250 |
| sort | optional | date_acquired | price_acquired, date_acquired, name, set, price_change, tcg_market, tcg_mid, foil_price |
| direction | optional | ASC | Change sort direction |
| cmc | optional | A math equation like '<=1' or '=0' or '>=5' | |
| color | optional | colorless, blue, white, red, multicolor, black, green | |
| tradable | optional | true, false | |
| reserve_list | optional | true, false | |
| price_under | optional | float number, return any item worth less than number | |
| price_over | optional | float number, return any item worth more than number |
Notes
POST Note Creation
Create a note in the system.
| field | required | default | description |
|---|---|---|---|
| target_app | optional | inventory | name of app to create note for |
| target_id | required | id of the resource the note is for, inventory id, earnings id, etc. | |
| note | required | text string note |
Lists
POST Lists: Add Item to List
Add an item to a list. If a non-foil is added as foil, it will default to non-foil vice versa.
| Param | Description |
|---|---|
| emid | (int) EchoID of card to add |
| list | (int) list id, see lists/all/ |
| foil | (int) 0=false, 1=true |
| sb | (int) sideboard 0=false, 1=true |
POST Lists: Remove Item
Add an item to a list. If a non-foil is added as foil, it will default to non-foil vice versa.
| Param | Description |
|---|---|
| emid | (int) EchoID of card to add |
| list | (int) list id, see lists/all/ |
| foil | (int) 0=false, 1=true |
| sb | (int) sideboard 0=false, 1=true |
POST Lists: Deck Reader
Read a deck, support formats are COD, DEC, Areana, Modo, DEK
'COD' => '/ '/ '/SB: \d\s(.*)\\n/', 'ARENA' => '/\d+\s+(.*)\s\([A-Za-z0-9]+\)\s\d+/', //1 Baird, Steward of Argive (DAR) 4 'MODO' => '/\d+\s+(.*)/'
| Param | Description |
|---|---|
| text | deck text |
POST Lists: Toggle Foil Copy
Add an item to a list. If a non-foil is added as foil, it will default to non-foil vice versa.
| Param | Description |
|---|---|
| emid | (int) EchoID of card to add |
| list | (int) list id, see lists/all/ |
| foil | (int) 0=false, 1=true |
| sb | (int) sideboard 0=false, 1=true |
POST Lists: Toggle Sideboard
Add an item to a list. If a non-foil is added as foil, it will default to non-foil vice versa.
| Param | Description |
|---|---|
| emid | (int) EchoID of card to add |
| list | (int) list id, see lists/all/ |
| foil | (int) 0=false, 1=true |
| sb | (int) sideboard 0=false, 1=true |
Earnings
POST Earnings: Adding Items
Add a card to the user inventory.
| Param | Required | Default | Description |
|---|---|---|---|
| emid | required | EchoID | |
| quantity | optional | 1 | number to record |
| language | optional | EN | Card text language. See language options below |
| condition | optional | NM | Card condition, see options below |
| foil | optional | 0 | 1=foiled, 0=regular |
| image | optional | A remote URL to an uploaded image. To add an image through Echo, see the Upload Image endpoint |
Condition Options
NM = Near Mint
LP = Lightly Played
MP = Moderately Played
HP = Heavily Played
D = Damaged
ALT = Altered
ART = Artist Proof
PRE = Pre-release
TS = Timestamped
SGN = Signed
BGS = BGS
B10 = BGS 10
B95 = BGS 9.5
B9 = BGS 9.0
B85 = BGS 8.5
B8 = BGS 8.0
B75 = BGS 7.5
B7 = BGS 7.0
PSA = PSA
P10 = PSA 10
P95 = PSA 9.5
P9 = PSA 9.0
P85 = PSA 8.5
P8 = PSA 8.0
P75 = PSA 7.5
P7 = PSA 7.0
Language Options
EN = english
DE = german
FR = french
RU = russian
IT = italian
ES = spanish
PT = portuguese
CT = chinese traditional
CS = chinese simplified
JP = japanese
KR = korean
Trades
Trades are inventory items mark as tradable, when items are marked for trade they become searchable in a public trade list.
GET Trades: View Haves
View user inventory. All options can be combined.
| Param | Required | Default | Description |
|---|---|---|---|
| user | required | The public user hash of the tradable user. | |
| conversion | optional | 1 | NOT SUPPORTED, currency return related to user trade list. Will be used for currency conversion against USD, 1.5 would return all prices 1.5*USD |
| start | optional | 0 | |
| limit | optional | 100 | Number to records to return, max is 250 |
| sort | optional | date_acquired | price_acquired, date_acquired, name, set, price_change, tcg_market, tcg_mid, foil_price |
| direction | optional | ASC | Change sort direction |
| min_value | optional | float number, return any item worth more than number | |
| max_value | optional | float number, return any item worth less than number |
GET Trades: View Wants
View user inventory. All options can be combined.
| Param | Required | Default | Description |
|---|---|---|---|
| user | required | The public username of the tradable user. | |
| conversion | optional | 1 | NOT SUPPORTED, currency return related to user trade list. Will be used for currency conversion against USD, 1.5 would return all prices 1.5*USD |
| start | optional | 0 | |
| limit | optional | 100 | Number to records to return, max is 250 |
| sort | optional | date_acquired | price_acquired, date_acquired, name, set, price_change, tcg_market, tcg_mid, foil_price |
| direction | optional | ASC | Change sort direction |
| min_value | optional | float number, return any item worth more than number | |
| max_value | optional | float number, return any item worth less than number |
Watchlist
Track item price movement in a watchlist.
Comments
POST Comments: Create
Create a comment on the platform.
| field | required | description |
|---|---|---|
| resource_id | required | id of the target resource |
| resource | required | string of the resource type |
| comment | required | comment string, markdown accepted |
| url | required | full URL of where the coment was made |
| thread_parent_id | optional | ID of the comment being responded to |
POST Comments: Delete
Create a note in the system.
| field | required | default | description |
|---|---|---|---|
| target_app | optional | inventory | name of app to create note for |
| target_id | required | id of the resource the note is for, inventory id, earnings id, etc. | |
| note | required | text string note |
Groups
Custom collection of item data.
GET Group: Get Single
Fetched items dedicated in a group based on specific request parameters. Defaults to sorting by pricing high to low.
Unique Options
true or false, determins where to return unique cards with no variants or not. default: false
Name Options
-
magic-reserved-list - magic reserve list
-
commanders - magic legendary creatures
-
lands - magic rare land cycles
-
artifacts - top 150 magic artifacts
-
tokens - top 150 magic tokens
-
creatures - top 150 magic creatures
-
power9 - magic power 9
-
tiny - magic tiny leaders
-
trendingup - magic items increasing in value
-
trendingdown - magic item decreasing in value
-
custom - look for a specific card type, see type options
Type Options
Type param only work with name=custom. Must be one part of a type like "merfolk" or "instant" or a fully qualified type like "Elf Druid". Examples:
-
Merfolk
-
Goblin
-
Instant
-
Elf Druid
-
Tribal
-
Enchantment
-
World Enchantment
Limit Options
Default is 150, accepting an integer. Optional.
Importing
Endpoints to import or read card data.
Articles
Create, edit, and retrieve articles.
Search and Data
GET Data: Search
Returns popular cards for a given game based on data in EchoMTG. This endpoint is restricted to login and EchoMTG websites.
| Required | Description | |
|---|---|---|
| tcg_id | true | TCGplayer ID |
| set | optional | Set Code as stored in EchoMTG |
| card | optional | Card name as stored in EchoMTG |
GET Data: Variants
Returns popular cards for a given game based on data in EchoMTG. This endpoint is restricted to login and EchoMTG websites.
| Required | Description | |
|---|---|---|
| tcg_id | true | TCGplayer ID |
| set | optional | Set Code as stored in EchoMTG |
| card | optional | Card name as stored in EchoMTG |
GET Data: Set
Fetches a set. Larger sets struggle to load in SSR apps. ?minified=true option added to reduce return sizes in half.
| Param | Required | Default | Description |
|---|---|---|---|
| set_code | true | 3-5 letter set code | |
| minified | false | true | Return results without card_text and purchase link |
| start | false | 0 | index to start at |
| limit | false | 5000 | total items to reutrn |
GET Data: Sets
Fetches a set. Larger sets struggle to load in SSR apps. ?minified=true option added to reduce return sizes in half.
| Param | Required | Default | Description |
|---|---|---|---|
| set_code | true | 3-5 letter set code | |
| minified | false | true | Return results without card_text and purchase link |
| start | false | 0 | index to start at |
| limit | false | 5000 | total items to reutrn |