The API endpoint is located at:
http://core.xdeep.io/run
This API uses the HTTP GET
method to retrieve model results.
model_id
(required): This parameter specifies the ID of the model you want to execute. You need to replace ID” with the actual model ID that you want to use.
data
(required): This parameter is used to provide the input vector for the model. It should be a list of numerical values enclosed in square brackets.
GET http://core.xdeep.io/run?model_id=YOUR_MODEL_ID&model_key=MODEL_KEY&data=[0.96331,-4.84262, ...]
The API returns a JSON response with the following structure:
{
"code": 1,
"message": "Model (ID) was executed successfully",
"model_response": [Model result]
}
code
: An integer value indicating the status of the request.
1: indicates a successful execution of the model.
0: indicates an error, and the “message” field will provide information about the error.
message
: A string that provides information about the result of the API call. If there is an error, this field will explain the nature of the error.
model_response
(only in case of success): This field contains the result produced by the model.
For Xdeep models, model_response
is designed to be a single numerical value, as Xdeep models are primarily single output models. If you have a problem that involves multiple outputs, we recommend modeling each output as a separate model within the Xdeep platform.
This approach allows you to effectively model and retrieve results for each individual output, ensuring clarity and simplicity in the API’s design. You can execute these individual models independently and obtain their respective results.
By modeling each output as a separate model, you can maintain the integrity of the API’s single numerical value response structure while addressing complex problems with multiple outputs.
If an error occurs, the code field in the response will be 0, and the message field will explain the nature of the error. The set of possible error messages is as follows:
Error: Model Does Not Exist
{
"code": 0,
"message": "Model (X) does not exist"
}
This error occurs when the model with ID X does not exist in the system
Error: Model Not Published
{
"code": 0,
"message": "Model (X) is not published"
}
This error occurs when the model with ID X exists but is not published, and therefore cannot be executed.
Error: Incorrect Model/Key combination
{
"code": 0,
"message": "Error in Model ID/KEY"
}
This error occurs when the provided key does not exist or does not match the specific model.
Error: Numerical Data Error
{
"code": 0,
"message": "Numerical error in provided data or data object"
}
This error occurs when the data parameter does not contain valid numerical values.
Error: No Data Provided
{
"code": 0,
"message": "No valid data or data object is provided"
}
This error occurs when the data parameter is missing or empty.
Ensure that you have the correct model_id
for the model you want to execute.
Check that the data
parameter is correctly formatted and contains valid numerical values.
Handle error responses appropriately by checking the code field and the error message in the message field.
Use the model_response
field to access the results produced by the model when the API call is successful.