Introduction

The JigLabs API is the interface where you can submit a request to receive the calculated response from a particular model based on your API Key.

API Calls can be made either with JSON payload or by sending multipart/form-data. The response is application/json -type.

To get your API Key, contact us at: info@jiglabs.io


API Call Location

The URL needed for an API call is:

https://api.jiglabs.io:443/classify/image

API Call Authorization

All API calls are authorized by using Caller ID, denoted in the examples as YOUR_API_KEY. The ID can be delivered in the HTTP header "Authorization" (standard way) or as html-form/JSON paramater "authorization".

Example HTTP header (Note: standard requires 'Bearer' before actual id):

Authorization: Bearer YOUR_API_KEY

Example HTML header:

<input type="text" name="authorization">

Example JSON parameter:

"authorization":"YOUR_API_KEY"

API Call by HTML Form

An HTML form can be used to make an API call. It must be delivered as "multipart/form-data" HTTP POST and the character encoding must be UTF-8. If the authorization ID is not delivered as part of the HTTP header, then it can be used with the parameter "authorization".

Click here to try an example implementation of fish species recognition (API Key = "test").

Parameters

  • authorization

    The provided API Key. This is not needed if already trasmitted as part of HTTP headers

  • results

    The returned number of results with their respective scores

  • image

    The image to be classified. The actual parameter name does not matter as long as an image is found in the multipart form

  • Example HTML Form

    <html>
      <head>
        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
        <meta charset="UTF-8">
      </head>
      <body>
        <h2>JigLabs API Example</h2>
        <form action="https://api.jiglabs.io:443/classify/image" enctype="multipart/form-data" method="post">
          <p>
          API-Key:
          <br>
          <input type="text" name="authorization">
          <br>
          Number of Results:
          <br>
          <input type="text" name="results">
          </p>
          <p>
          Image:
          <br>
          <input type="file" name="datafile">
          </p>
          <div>
            <input type="submit" value="Send">
          </div>
        </form>
      </body>
    </html>

    API Call by JSON

    A JSON message can be used to make an API call. It must be delivered as HTTP POST with "Content-type: application/json" and the character encoding must be UTF-8.

    Parameters

  • authorization

    The provided API Key. This is not needed if already trasmitted as part of HTTP headers

  • results

    The returned number of results with their respective scores

  • image

    The image to be classified with Base64 encoding using "The Base64 Alphabet" as specified in Table 1 of RFC 4648 and RFC 2045

  • Example JSON payload for call

    Note: Base64 encoding is not shown in its entirety in example
    {
      "authorization":"YOUR_API_KEY",
      "results":5,
      "image":"/9j/4AAQSkZJRgABAQEA ... JIFI//9k="
    }

    Example Response

    The API response is delivered in JSON format with the highest probability sorted at the top

    JSON Names

  • confidence

    The confidence the algorithm calculates for the given classification

  • classificatoin

    The recognized classifcation of the image

  • Example API Response with "results" set to 5

    The image submitted was of a walleye fish species
    [
      {
        "confidence": "99%",
        "classification": "Walleye"
      },
      {
        "confidence": "0%",
        "classification": "Sauger"
      },
      {
        "confidence": "0%",
        "classification": "Largemouth Bass"
      },
      {
        "confidence": "0%",
        "classification": "White Sucker"
      },
      {
        "confidence": "0%",
        "classification": "Yellow Perch"
      }
    ]