GiniMachine API documentation is split into three sections: authentication, endpoints section and sdk usage samples.
All requests are made to endpoints beginning:
https://gcredit.ginimachine.com/
All requests must be secure, i.e. https, not http.
The API endpoint bodies support two content types JSON and tab-delimited CSV. It’s specified at the end of the endpoint URL.
In order to make a single API call to GiniMachine, you will need to attach an access token to the request headers.
- Log into the web interface of GiniMachine:
https://gcredit.ginimachine.com/profile - Click on the Generate button and copy the generated access token.
For every http request pass the value of the access token as an Authorization header with type API Key.
When integrating with the model, it is crucial to ensure that the structure of the request JSON file aligns with the structure of the model itself.
This means that if the dataset used for modeling consists of 50 columns, the request body should contain 49 columns. The "ok" column should not be included as it serves as an outcome column that the model will predict.
It is important for the column names to match the JSON representation. For instance, if the training dataset has a column named "age_on_application" the JSON should also include this column with the exact same name, including case sensitivity.
Here you could find our Youtube video guide explaining the API integration with GiniMachine.

Query params

Response status codes
- Status: 200 - OK
- Status: 201 - Created
- Status: 400 - Bad Request
The operation was not completed;
Limit exceeded
- Status: 401 - Unauthorized
- Status: 403 - Forbidden
- Status: 404 - Model with id not Found
Response body example
The process uses additional heuristics to calculate the effect of each feature on the prediction. So, the inference time can vary in this case.

Query params

Response status codes
- Status: 200 - OK
- Status: 201 - Created
- Status: 400 - Bad Request
The operation was not completed;
Limit exceeded
- Status: 401 - Unauthorized
- Status: 403 - Forbidden
- Status: 404 - Model with id not Found
Response body example

Query params

Response status codes
- Status: 200 - OK
- Status: 201 - Created
- Status: 400 - Bad Request
The operation was not completed;
Limit exceeded
- Status: 401 - Unauthorized
- Status: 403 - Forbidden
- Status: 404 - Model with id not Found

Query params

Response status codes
- Status: 200 - OK
- Status: 201 - Created
- Status: 400 - Bad Request
The operation was not completed;
Limit exceeded
- Status: 401 - Unauthorized
- Status: 403 - Forbidden
- Status: 404 - Model with id not Found
Curl SDK
curl --location --request POST 'https://gcredit.ginimachine.com.ginimachine.com/api/v1/scoring/predict.json?modelId=4' \
--header 'Content-Type: application/json' \
--data-raw '[{
"amount": "30000",
"source_type": "OFFLINE",
"remittance_type": "CASH",
"term": 21,
"income": 120000,
"occupation_type": "SERVICES",
"pension_contributions": true,
"criminal_record": false,
"marital_status": "SINGLE",
"add_info_fraud": false,
"add_info_inadequate": false,
"add_info_poor_appearance": false,
"credit_product_id": "1",
"verificator_id": "1",
"partner_id": "1",
"add_income_pension": true,
"add_info_call_before_visit": true,
"had_arrears": true,
"had_credits_before": true,
"has_active_credit": true,
"monthly_payment": 1200,
"pt_income": 0,
"banned": false
}]
'
JavaScript SDK
var settings = {
"url": "https://gcredit.ginimachine.com.ginimachine.com/api/v1/scoring/predict.json?modelId=4",
"method": "POST",
"timeout": 0,
"headers": {
"Content-Type": "application/json"
},
"data": JSON.stringify([
{
"amount": "30000",
"source_type": "OFFLINE",
"remittance_type": "CASH",
"term": 21,
"income": 120000,
"occupation_type": "SERVICES",
"pension_contributions": true,
"criminal_record": false,
"marital_status": "SINGLE",
"add_info_fraud": false,
"add_info_inadequate": false,
"add_info_poor_appearance": false,
"credit_product_id": "1",
"verificator_id": "1",
"partner_id": "1",
"add_income_pension": true,
"add_info_call_before_visit": true,
"had_arrears": true,
"had_credits_before": true,
"has_active_credit": true,
"monthly_payment": 1200,
"pt_income": 0,
"banned": false
}
]),
};
$.ajax(settings).done(function (response) {
console.log(response);
});
C# SDK
var client = new RestClient("https://gcredit.ginimachine.com.ginimachine.com/api/v1/scoring/predict.json?modelId=4");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
var body = @"[{" + "\n" +
@" ""amount"" : ""30000""," + "\n" +
@" ""source_type"" : ""OFFLINE""," + "\n" +
@" ""remittance_type"" : ""CASH""," + "\n" +
@" ""term"" : ""21""," + "\n" +
@" ""income"" : ""120000""," + "\n" +
@" ""occupation_type"" : ""SERVICES""," + "\n" +
@" ""pension_contributions"" : ""true""," + "\n" +
@" ""criminal_record"" : ""false""," + "\n" +
@" ""marital_status"" : ""SINGLE""," + "\n" +
@" ""add_info_fraud"" : ""false""," + "\n" +
@" ""add_info_poor_appearance"" : ""false""," + "\n" +
@" ""credit_product_id"" : ""1""," + "\n" +
@" ""verificator_id"" : ""1""," + "\n" +
@" ""partner_id"" : ""1""" + "\n" +
@" ""add_income_pension"" : ""true""" + "\n" +
@" ""add_info_call_before_visit"" : ""true""" + "\n" +
@" ""had_arrears"" : ""true""" + "\n" +
@" ""had_credits_before"" : ""true""" + "\n" +
@" ""has_active_credit"" : ""true""" + "\n" +
@" ""monthly_payment"" : ""1200""" + "\n" +
@" ""pt_income"" : ""0""" + "\n" +
@" ""banned"" : ""false""" + "\n" +
@"}]" + "\n" +
@"";t.AddParameter("application/json", body, ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
Python SDK
import requests
import json
url = "https://gcredit.ginimachine.com.ginimachine.com/api/v1/scoring/predict.json?modelId=4"
payload = json.dumps([
{
"amount": "30000",
"source_type": "OFFLINE",
"remittance_type": "CASH",
"term": 21,
"income": 120000,
"occupation_type": "SERVICES",
"pension_contributions": true,
"criminal_record": false,
"marital_status": "SINGLE",
"add_info_fraud": false,
"add_info_inadequate": false,
"add_info_poor_appearance": false,
"credit_product_id": "1",
"verificator_id": "1",
"partner_id": "1",
"add_income_pension": true,
"add_info_call_before_visit": true,
"had_arrears": true,
"had_credits_before": true,
"has_active_credit": true,
"monthly_payment": 1200,
"pt_income": 0,
"banned": false
}
])
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
#With empty columns list
url = "https://gcredit.ginimachine.com.ginimachine.com/api/v1/scoring/predict.json?modelId=4"
payload = json.dumps([
{
"amount": "30000",
"source_type": "OFFLINE",
"remittance_type": "CASH",
"term": 21,
"income": 120000,
"occupation_type": "SERVICES",
"pension_contributions": true,
"criminal_record": false,
"marital_status": "SINGLE",
"add_info_fraud": false,
"add_info_inadequate": false,
"add_info_poor_appearance": false,
"credit_product_id": "1",
"verificator_id": "1",
"partner_id": "1",
"add_income_pension": true,
"add_info_call_before_visit": true,
"had_arrears": true,
"had_credits_before": true,
"has_active_credit": true,
"monthly_payment": 1200,
"pt_income": 0,
"banned": false
}
])
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
Got a question?
Contact us: support@ginimachine.com