Predict API Docs for:

This interface takes in {{ len_inputs }} input(s) and returns {{ len_outputs }} output(s).

The URL endpoint is:

Input(s): [{%for i in range(0, len_inputs)%} {{inputs[i]}}{% if i != len_inputs - 1 %} ,{% endif %}{%endfor%} ]

Output(s): [{%for i in range(0, len_outputs)%} {{outputs[i]}}{% if i != len_outputs - 1 %} ,{% endif %}{%endfor%} ]

Payload:

  {

    "data": [{%for i in range(0, len_inputs)%} {{ input_types[i] }}{% if i != len_inputs - 1 %} ,{% endif %}{%endfor%} ]

  }

{% if auth is not none %}

Note: This interface requires authentication. This means you will have to first post to the login api before you can post to the predict endpoint. See below for more info

{% endif %}

Response:

  {

    "data": [{%for i in range(0, len_outputs)%} {{ output_types[i] }}{% if i != len_outputs - 1 %} ,{% endif %}{%endfor%} ],

    "durations": [ float ], # the time taken for the prediction to complete

    "avg_durations": [ float ] # the average time taken for all predictions so far (used to estimate the runtime)

  }

Try it (live demo):

{% if auth is not none %}

import requests


sess = requests.session()


sess.post(url='

',

data={"username": "USERNAME", "password":"PASSWORD"})

r = sess.post(url='

',

json={"data":

[{% for i in range(0, len_inputs) %}{{ sample_inputs[i]|tojson }}{% if i != len_inputs - 1 %}

,

{% endif %}{%endfor%}

]})

r.json()

{% else %}

import requests


r = requests.post(url='

',

json={"data":

[{% for i in range(0, len_inputs) %}{{ sample_inputs[i]|tojson }}{% if i != len_inputs - 1 %}

,

{% endif %}{%endfor%}

]})

r.json()

{% endif %}
{% if auth is not none %}

curl -X POST -F 'username=USERNAME' -F 'password=PASSWORD'  -c cookies.txt

curl -X POST 

 -H 'Content-Type: application/json' -d '{"data": [{%for i in range(0, len_inputs)%}{{ sample_inputs[i]|tojson }}{% if i != len_inputs - 1 %}

,

{% endif %}{%endfor%}

]}' -b cookies.txt

{% else %}

curl -X POST 

 -H 'Content-Type: application/json' -d '{"data": [{%for i in range(0, len_inputs)%}{{ sample_inputs[i]|tojson }}{% if i != len_inputs - 1 %}

,

{% endif %}{%endfor%}

]}'

{% endif %}
{% if auth is not none %}

// Will only work locally.


fetch('', { method: "POST", body: "username=USERNAME&password=PASSWORD"

, credentials: 'same-origin', headers: { "Content-Type": "application/x-www-form-urlencoded" } })


fetch('', { method: "POST", body: JSON.stringify({"data":[{%for i in range(0, len_inputs)%} {{ sample_inputs[i]|tojson }}{% if i != len_inputs - 1 %},{% endif %}{%endfor%}

]}), credentials: 'same-origin', headers: { "Content-Type": "application/json" } }).then(function(response) { return response.json(); }).then(function(json_response){ console.log(json_response) })

{% else %}

fetch('', { method: "POST", body: JSON.stringify({"data":[{%for i in range(0, len_inputs)%} {{ sample_inputs[i]|tojson }}{% if i != len_inputs - 1 %},{% endif %}{%endfor%}

]}), headers: { "Content-Type": "application/json" } }).then(function(response) { return response.json(); }).then(function(json_response){ console.log(json_response) })

{% endif %}
{% if auth is not none %}

Live POST is turned off for interfaces that require authentication.

{% endif %}