A fetching API for ABU Power and ABUR Duals, both the indexes themselves and the individual data points.
/api/<set>/<type>/<name> - API endpoint for specific card data
/api/<set>/<type>/table - API endpoint for general set data
GET | | POST | DELETEPUT
Required:
set=[string] - i.e. "alpha" or "beta"
type=[string] - i.e. "power" or "duals"
name=[string] - i.e. "mox jet" or "mox-jet"
- Code: 200
Content:{ results : [json array] }
- Code: 404 Not Found
Content:{ results : failed }, { error : errorMessage }
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
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. 😊