Skip to content

Latest commit

 

History

History
82 lines (56 loc) · 2.38 KB

File metadata and controls

82 lines (56 loc) · 2.38 KB

Micro API Documentation

A fetching API for ABU Power and ABUR Duals, both the indexes themselves and the individual data points.

URL

/api/<set>/<type>/<name> - API endpoint for specific card data
/api/<set>/<type>/table - API endpoint for general set data

Method

GET | POST | DELETE | PUT

URL Params

Required:

set=[string] - i.e. "alpha" or "beta"
type=[string] - i.e. "power" or "duals"
name=[string] - i.e. "mox jet" or "mox-jet"

Success Response

  • Code: 200
    Content: { results : [json array] }

Error Response

  • Code: 404 Not Found
    Content: { results : failed }, { error : errorMessage }

Sample GET Call

The below calls are very basic implementations. I would highly recommend wrapping them in functions with proper checks if you are going to be sending numerous requests.

  • JavaScript | AJAX & XHR
    var url = $.get(`https://abupower.com/api/beta/duals/table`)
    var response = url.responseJSON['results']
    
    &
    var data = JSON.stringify(false);
    
    var xhr = new XMLHttpRequest();
    xhr.withCredentials = true;
    
    xhr.addEventListener("readystatechange", function () {
      if (this.readyState === this.DONE) {
        console.log(this.responseText);
      }
    });
    
    xhr.open("GET", "https://abupower.com/api/unlimited/duals/tundra");
    
    xhr.send(data);
    
  • Python | Requests
    url = "https://abupower.com/api/alpha/power/table"
    response = requests.get(url).json()
    results = response['results']
    
  • Linux | cURL
    curl --request GET --url https://abupower.com/api/alpha/power/table
    

Notes

I am happy to answer any questions or implement any improvements that are recommended or advised. Thanks for checking out my micro API documentation :).

Last updated by Cooper Ribb @ 10/8/2018, 8:17AM CST. 😊