Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: No address associated with hostname in /home/technic/public_html/content/public-api/index.php on line 70

Warning: file_get_contents(https://techniconica.com/api/parts/): failed to open stream: php_network_getaddresses: getaddrinfo failed: No address associated with hostname in /home/technic/public_html/content/public-api/index.php on line 70

Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: No address associated with hostname in /home/technic/public_html/content/public-api/index.php on line 70

Warning: file_get_contents(https://techniconica.com/api/parts/1/): failed to open stream: php_network_getaddresses: getaddrinfo failed: No address associated with hostname in /home/technic/public_html/content/public-api/index.php on line 70
Our Public API | Techniconica - A Mech Combat Card Game!
Techniconica - The Mech Combat Card Game

The Mech Combat Card Game

+44 (0)1274 985905     
View Your Cart

0 items

£0.00

Our Public API

Basic Usage

We have made available a public API for retrieving information about the Techniconica Part & Pilot cards.

This can be done by sending a standard "GET" request to:-

https://techniconica.com/api/parts/

The API will return a JSON encoded array allowing your app or website to take the information and use the various parameters passed to and from our API in your application.

The default call send back a list of all the current parts currently available along with some meta data about those parts.

An example of the request can be found below:-

Card Specific Meta Data

If you need to retrieve more information about a particular part, such as getting a breakdown of it's stats, then simply pass the "card number" to our API:

https://techniconica.com/api/parts/[card_number]/

Our API will fetch more information about that particular part or card (again in JSON format).

As an example, submitting a GET request to:

https://techniconica.com/api/parts/1/

The above will return the following:-

Code Examples

PHP

If you need to consume our publicly available data and make it available for use in your PHP file(s) as an array, then the following snippet may be a useful base to start from:

<?php
    $data = file_get_contents("https://techniconica.com/api/parts/");
    $parts_summary = json_decode($data, true);
    print_r($parts_summary);
?>

It may be worth considering caching the results locally on your server (either as a file or in a database table) to improve the speed of your application.

Javascript

Below is a function you can use in your Javascript application to get data from our API. Please note that this snippet uses jQuery so your project will need to have this library there for it to work. Otherwise you are going to have to issue a standard AJAX call to the relevant API URI:-

    function getTechniconicaData(card_number) {
        var url = 'https://techniconica.com/api/parts/';
        //Getting a specifc card number?
        if (isNaN(card_number)) url += card_number + '/';
        jQuery.getJSON(url, function(data) {
            //Do something with the JSON data
        });
    }

The get the data in a variable inside one of your own functions, you can use the following inside your function or scripts.

getTechniconicaData('');

Please note that the code above requires jQuery to function - a non-jQuery function is coming soon.

Errors/Malformed Requests

If you encounter any errors, either from out of bounds requests, or an invalid card number etc, the API will respond with an empty request.

Other Information Types

We make available information about our Mech Parts and we also make available information about .the Techniconica Universe and our Timeline.

The respective API endpoints for these are:

Universe Articles

https://techniconica.com/api/universe/

Timeline Events

https://techniconica.com/api/timeline/

These are made available for those that want to create a more rounded experience for fans of Techniconica - even if the intended audience is somewhat more limited in scope than our parts API.

Technical Considerations

The API itself was built to be fairly simple from the outset to ease application development.

Caching

It is strongly recommended that you enable simple caching in your application, not only to ease the load on our servers, but also to increase the speed and responsiveness of your application.

In Javascript, you can simply declare a global Javascript object and store the part information as native JS objects referrenced by part number.

Rate Limiting

At the moment, there are no immediate plans to rate limit the API, although if uptake of the public API becomes excessive where it starts affecting our servers in a negative manner, we may implement rate limiting on our API calls to ensure that we can provide our own users with a quality of service they can expect from us.

Existing Implementations

The the Part card part of the API is fairly stable and is actually already natively being consumed by our own Mech Builder application.

Our Mech Builder caches the requests locally in a simple Javascript object structure, allowing for a considerable speed increase and lower latency on follow up requests.