Introduction
The Spikeet Developer API provides you with an alternative way to interact with our platform. The API is organized around REST and uses JSON encoded request and responses.
The Spikeet Developer API allows you to:
- Create, fetch, edit and delete webhooks
- Create and fetch your data requests
Quickstart
The Spikeet Developer API authenticates your API requests using an API key that is attached to an application. You can retrieve your API key by visiting your dashboard. This API key needs to be sent in the api-key header of every request.
After you get an API key, you need to setup webhooks to get the output of the data requests you created. Each webhook requires a url that corresponds to an HTTP endpoint that accepts POST requests and an event associated to the url. Currently we support 2 events:
- data_request_error which is invoked when there is an error with a data request and
- data_request_success which is invoked when a data request completes successfully
Authentication
To authorize, use this code:
import requests
url = "api_endpoint_here"
headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"api-key": "{YOUR_API_KEY}"
}
response = requests.request("GET", url, headers=headers)
print(response.json())
curl "api_endpoint_here" \
-H "api-key: {YOUR_API_KEY}"
-H "Accept: application/json"
-H "Content-Type: application/json"
const url = new URL("api_endpoint_here");
const headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"api-key": "{YOUR_API_KEY}",
};
fetch(url, {
method: "GET",
headers: headers
})
.then(response => response.json())
.then(json => console.log(json));
Make sure to replace
{YOUR_API_KEY}with your API key.
To authenticate requests, include the api-key header with the value "{YOUR_API_KEY}".
All authenticated endpoints are marked with a requires authentication badge in the documentation below.
You can retrieve your API key by visiting your dashboard and creating an application.
Webhook
Create Webhook
Example Request:
import requests
url = "https://developer.staging.spikeet.com/v1/api/webhooks"
headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"api-key": "{YOUR_API_KEY}"
}
payload = {
"url": "https://example.com/webhook",
"event": "data_request_success",
"active": True
}
response = requests.request("POST", url, json=payload, headers=headers)
print(response.json())
curl --request POST \
"https://developer.staging.spikeet.com/v1/api/webhooks" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--header "api-key: {YOUR_API_KEY}" \
--data '{
"url": "https://example.com/webhook",
"event": "data_request_success",
"active": true
}'
const url = new URL(
"https://developer.staging.spikeet.com/v1/api/webhooks"
);
const headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"api-key": "{YOUR_API_KEY}",
};
const body = {
"url": "https://example.com/webhook",
"event": "data_request_success",
"active": true
}
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(body),
})
.then(response => response.json())
.then(json => console.log(json));
200 Response:
{
"active": true,
"created_at": "2021-01-01T00:00:00.000Z",
"updated_at": "2021-01-01T00:00:00.000Z",
"deleted_at": null,
"created_by": "user@gmail.com",
"deleted_by": null,
"_id": "6197999053cc7ecf35b56eef",
"url": "https://example.com/webhook",
"event": "data_request_completed",
"application_id": "618cd8405b3d132051ae061f",
"__v": 0
}
400 Response:
{
"timestamp": "2021-11-24T21:45:24.410Z",
"errors": [
{
"field": "url",
"message": "url is required"
},
{
"field": "event",
"message": "event is required"
},
{
"field": "active",
"message": "active is required"
}
]
}
401 Response:
{
"timestamp": "2021-11-24T21:34:02.108Z",
"errors": [
"You are not authorized to access this resource"
]
}
403 Response:
{
"timestamp": "2021-11-24T21:34:02.108Z",
"errors": [
"You are not allowed to access this resource"
]
}
500 Response:
{
"timestamp": "2021-11-24T21:34:02.108Z",
"errors": [
"Oops, Something went wrong!"
]
}
A webhook is a user defined HTTP callbacks that allows you to send real-time information whenever a given event occurs. A webhook can be thought of as a type of API that is driven by events rather than requests. Instead of one application making a request to another to receive a response, a webhook is a service that allows one program to send data to another as soon as a particular event takes place.
Say for instance you want to get the output of a data request after it completes. Data requests can take a long period to complete and so instead of continuously sending a request to get the status of the data request, an application can sit back and get notified when the request completes.
You can configure webhook endpoints via the API to get the output of your data requests by setting up an HTTP endpoint that accepts unauthenticated webhook requests with a POST method. Each webhook requires a url that points to an endpoint and an event associated to the url. You also need to specify the Boolean active parameter, that indicates if the webhook is active or not.
Supported Events:
- data_request_error: Is triggered when there is an error with the data request
- data_request_success: Is triggered when the data request completes successfully
Request
POST /v1/api/webhooks
Body Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| url | string | Yes | The URL of the webhook. |
| event | string | Yes | An event that is associated to the webhook endpoint. |
| active | boolean | Yes | Indicates the status of the webhook. It can either be true or false. |
Get Webhooks
import requests
url = "https://developer.staging.spikeet.com/v1/api/webhooks?page=1&limit=25"
headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"api-key": "{YOUR_API_KEY}"
}
response = requests.request("GET", url, headers=headers)
print(response.json())
curl --request GET \
--get "https://developer.staging.spikeet.com/v1/api/webhooks?page=1&limit=25" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--header "api-key: {YOUR_API_KEY}"
const url = new URL("https://developer.staging.spikeet.com/v1/api/webhooks?page=1&limit=25");
const headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"api-key": "{YOUR_API_KEY}",
};
fetch(url, {
method: "GET",
headers: headers
})
.then(response => response.json())
.then(json => console.log(json));
200 Response:
{
"result": [
{
"active": true,
"created_at": "2021-01-01T00:00:00.000Z",
"updated_at": "2021-01-01T00:00:00.000Z",
"deleted_at": null,
"created_by": "user@gmail.com",
"deleted_by": null,
"_id": "6197999053cc7ecf35b56eef",
"url": "https://example.com/webhook",
"event": "data_request_completed",
"application_id": "618cd8405b3d132051ae061f",
"__v": 0
}
],
"metadata": {
"pagination": {
"page": 1,
"limit": 25,
"numberOfResults": 4,
"numberOfPages": 1
}
}
401 Response:
{
"timestamp": "2021-11-24T21:34:02.108Z",
"errors": [
"You are not authorized to access this resource"
]
}
403 Response:
{
"timestamp": "2021-11-24T21:34:02.108Z",
"errors": [
"You are not allowed to access this resource"
]
}
500 Response:
{
"timestamp": "2021-11-24T21:34:02.108Z",
"errors": [
"Oops, Something went wrong!"
]
}
Returns a list of webhooks associated with your application. The object with the result property contains an array of the webhook objects. If no webhooks are available it will be empty.
Request
GET /v1/api/webhooks?page={page}&limit={limit}
Query Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| page | number | No | Page number. The default is 1. |
| limit | number | No | A limit on the number of records to be returned. The default is 25. |
Get Webhook By ID
import requests
url = "https://developer.staging.spikeet.com/v1/api/webhooks/6197999053cc7ecf35b56eef"
headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"api-key": "{YOUR_API_KEY}"
}
response = requests.request("GET", url, headers=headers)
print(response.json())
curl --request GET \
--get "https://developer.staging.spikeet.com/v1/api/webhooks/6197999053cc7ecf35b56eef" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--header "api-key: {YOUR_API_KEY}"
const url = new URL("https://developer.staging.spikeet.com/v1/api/webhooks/6197999053cc7ecf35b56eef");
const headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"api-key": "{YOUR_API_KEY}",
};
fetch(url, {
method: "GET",
headers: headers
})
.then(response => response.json())
.then(json => console.log(json));
200 Response:
{
"active": true,
"created_at": "2021-01-01T00:00:00.000Z",
"updated_at": "2021-01-01T00:00:00.000Z",
"deleted_at": null,
"created_by": "user@gmail.com",
"deleted_by": null,
"_id": "6197999053cc7ecf35b56eef",
"url": "https://example.com/webhook",
"event": "data_request_completed",
"application_id": "618cd8405b3d132051ae061f",
"__v": 0
}
401 Response:
{
"timestamp": "2021-11-24T21:34:02.108Z",
"errors": [
"You are not authorized to access this resource"
]
}
403 Response:
{
"timestamp": "2021-11-24T21:34:02.108Z",
"errors": [
"You are not allowed to access this resource"
]
}
404 Response:
{
"timestamp": "2021-11-24T21:34:02.108Z",
"errors": [
"Webhook not found"
]
}
500 Response:
{
"timestamp": "2021-11-24T21:34:02.108Z",
"errors": [
"Oops, Something went wrong!"
]
}
Returns a webhook with the given Id. If the id is not valid it will return a 404 error.
Request
GET /v1/api/webhooks/:id
URL Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Webhook Id. |
Update Webhook
import requests
url = "https://developer.staging.spikeet.com/v1/api/webhooks/6197999053cc7ecf35b56eef"
headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"api-key": "{YOUR_API_KEY}"
}
payload = {
"url": "https://example.com/webhook",
"event": "data_request_success",
"active": True
}
response = requests.request("PUT", url, json=payload, headers=headers)
print(response.json())
curl --request PUT \
"https://developer.staging.spikeet.com/v1/api/webhooks/6197999053cc7ecf35b56eef" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--header "api-key: {YOUR_API_KEY}" \
--data '{
"url": "https://example.com/webhook",
"event": "data_request_success",
"active": false
}'
const url = new URL(
"https://developer.staging.spikeet.com/v1/api/webhooks/6197999053cc7ecf35b56eef"
);
const headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"api-key": "{YOUR_API_KEY}",
};
const body = {
"url": "https://example.com/webhook",
"event": "data_request_success",
"active": false
}
fetch(url, {
method: "PUT",
headers: headers,
body: JSON.stringify(body),
})
.then(response => response.json())
.then(json => console.log(json));
200 Respone:
{
"active": false,
"created_at": "2021-01-01T00:00:00.000Z",
"updated_at": "2021-01-01T00:00:00.000Z",
"deleted_at": null,
"created_by": "user@gmail.com",
"deleted_by": null,
"_id": "6197999053cc7ecf35b56eef",
"url": "https://example.com/webhook",
"event": "data_request_success",
"application_id": "618cd8405b3d132051ae061f",
"__v": 0
}
401 Response:
{
"timestamp": "2021-11-24T21:34:02.108Z",
"errors": [
"You are not authorized to access this resource"
]
}
403 Response:
{
"timestamp": "2021-11-24T21:34:02.108Z",
"errors": [
"You are not allowed to access this resource"
]
}
404 Response:
{
"timestamp": "2021-11-24T21:34:02.108Z",
"errors": [
"Webhook not found"
]
}
500 Response:
{
"timestamp": "2021-11-24T21:34:02.108Z",
"errors": [
"Oops, Something went wrong!"
]
}
Updates a webhook endpoint. You can edit the url, event and active fields.
Request
PUT /v1/api/webhooks/:id
URL Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Webhook Id. |
Body Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| url | string | No | The URL of the webhook. |
| event | string | No | An event that is associated to the webhook endpoint. |
| active | boolean | No | Indicates the status of the webhook. It can either be true or false. |
Delete Webhook
import requests
url = "https://developer.staging.spikeet.com/v1/api/webhooks/6197999053cc7ecf35b56eef"
headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"api-key": "{YOUR_API_KEY}"
}
response = requests.request("DELETE", url, headers=headers)
print(response.json())
curl --request DELETE \
"https://developer.staging.spikeet.com/v1/api/webhooks/60f7e3b6dc6ef05f3e6fbaaf" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--header "api-key: {YOUR_API_KEY}"
const url = new URL("https://developer.staging.spikeet.com/v1/api/webhooks/6197999053cc7ecf35b56eef");
const headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"api-key": "{YOUR_API_KEY}",
};
fetch(url, {
method: "DELETE",
headers: headers
})
.then(response => response.json())
.then(json => console.log(json));
200 Response:
{
"active": true,
"created_at": "2021-01-01T00:00:00.000Z",
"updated_at": "2021-01-01T00:00:00.000Z",
"deleted_at": "2021-01-01T00:00:00.000Z",
"created_by": "user@gmail.com",
"deleted_by": "user@gmail.com",
"_id": "6197999053cc7ecf35b56eef",
"url": "https://example.com/webhook",
"event": "data_request_completed",
"application_id": "618cd8405b3d132051ae061f",
"__v": 0
}
401 Response:
{
"timestamp": "2021-11-24T21:34:02.108Z",
"errors": [
"You are not authorized to access this resource"
]
}
403 Response:
{
"timestamp": "2021-11-24T21:34:02.108Z",
"errors": [
"You are not allowed to access this resource"
]
}
404 Response:
{
"timestamp": "2021-11-24T21:34:02.108Z",
"errors": [
"Webhook not found"
]
}
500 Response:
{
"timestamp": "2021-11-24T21:34:02.108Z",
"errors": [
"Oops, Something went wrong!"
]
}
Deletes a webhook witht the given Id.
Request
DELETE /v1/api/webhooks/:id
URL Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Webhook Id. |
Data Requests
Create Data Request
Example Request:
import requests
url = "https://developer.staging.spikeet.com/v1/api/data-requests"
headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"api-key": "{YOUR_API_KEY}"
}
payload = {
"name": "Request #1",
"sort_by_column": "date",
"filters": {
"Technical": {
"Daily": [...],
"Intraday": [...]
},
"Custom": [...],
"Fundamental": [...],
"Identity": [...],
"Indicator": [...],
"Date_Range": {
"start_date": "2020-01-01",
"end_date": "2021-01-01"
}
},
"columns": {
"Technical": {
"Daily": [...],
"Intraday": [...]
},
"Custom": [...],
"Earnings": [...],
"Fundamental": [...],
"Indicator": [...],
"Identity": [...]
},
"data_request_email": False,
"data_update_email": False
}
response = requests.request("POST", url, json=payload, headers=headers)
print(response.json())
curl --request POST \
"https://developer.staging.spikeet.com/v1/api/data-requests" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--header "api-key: {YOUR_API_KEY}" \
--data '{
"name": "Request #1",
"sort_by_column": "date",
"filters": {
"Technical": {
"Daily": [...],
"Intraday": [...]
},
"Custom": [...],
"Fundamental": [...],
"Identity": [...],
"Indicator": [...],
"Date_Range": {
"start_date": "2020-01-01",
"end_date": "2021-01-01"
}
},
"columns": {
"Technical": {
"Daily": [...],
"Intraday": [...]
},
"Custom": [...],
"Earnings": [...],
"Fundamental": [...],
"Indicator": [...],
"Identity": [...]
},
"data_request_email": false,
"data_update_email": false
}'
const url = new URL(
"https://developer.staging.spikeet.com/v1/api/data-requests"
);
const headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"api-key": "{YOUR_API_KEY}",
};
const body = {
"name": "Request #1",
"sort_by_column": "date",
"filters": {
"Technical": {
"Daily": [...],
"Intraday": [...]
},
"Custom": [...],
"Fundamental": [...],
"Identity": [...],
"Indicator": [...],
"Date_Range": {
"start_date": "2020-01-01",
"end_date": "2021-01-01"
}
},
"columns": {
"Technical": {
"Daily": [...],
"Intraday": [...]
},
"Custom": [...],
"Earnings": [...],
"Fundamental": [...],
"Indicator": [...],
"Identity": [...]
},
"data_request_email": false,
"data_update_email": false
}
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(body),
})
.then(response => response.json())
.then(json => console.log(json));
200 Response:
{
"_id": "61702293f09be1aaa0851e25",
"user_id": "60e58159273da6672e1b5d91",
"subscription_id": "60e37c4c7426ae6a673e527d",
"folder_id": null,
"application_id": "60f7e1e473fbe65abef9a761",
"name": "Sample",
"status": "Finished",
"filters": {
"Technical": {
"Daily": [...],
"Intraday": [...]
},
"Custom": [...],
"Fundamental": [...],
"Identity": [...],
"Indicator": [...],
"Date_Range": {
"start_date": "2021-01-01T00:00:00.000Z",
"end_date": "2021-01-01T00:00:00.000Z"
}
},
"columns": {
"Technical": {
"Daily": [...],
"Intraday": [...]
},
"Custom": [...],
"Earnings": [...],
"Fundamental": [...],
"Indicator": [...],
"Identity": [...]
},
"sort_by_column": "date",
"download_allowed": false,
"identifier": "C4YlERmnGbHXJLeDl42Ve3BvN",
"type": {
"source": "Api",
"is_custom": false,
"triggered_by_special_permission": false,
"user_roles": []
},
"settings": {
"data_updates_output": {
"aws_upload": false,
"new_zoho_workbook": false,
"new_zoho_worksheet": false,
"new_zoho_worksheet_per_update": false,
"append_to_data_update_worksheet": false,
"append_to_data_request_worksheet": false
},
"data_request_email": {
"send_completed_email": true,
"send_failed_email": true,
"send_completed_email_to_admin": false,
"send_failed_email_to_admin": true
},
"data_update_email": {
"send_completed_email": true,
"send_failed_email": true,
"send_completed_email_to_admin": false,
"send_failed_email_to_admin": true
},
"webhook": {
"enable_data_update": true,
"enable_data_request": true
}
},
"duration": {
"start": "2021-01-01T00:00:00.000Z",
"end": "2021-01-01T00:00:00.000Z"
},
"custom_script": null,
"data_updates": {
"current": false,
"original": false
},
"zoho_permission": {
"view": true,
"edit": true,
"download": true
},
"created_at": "2021-01-01T00:00:00.000Z",
"last_update_date": "2021-01-01T00:00:00.000Z",
"updated_at": "2021-01-01T00:00:00.000Z",
"deleted_at": null,
"created_by": "user@email.com",
"deleted_by": null,
"__v": 0,
"output": {
"output": "",
"error": null
},
"aws_resource": {
"url": "https://spikeet-developer-data-request-staging.s3.amazonaws.com/user@email.com/C4YlERmnGbHXJLeDl42Ve3BvN/Sample.xlsx"
},
"id": "61702293f09be1aaa0851e25"
}
400 Response:
{
"timestamp": "2021-11-25T19:24:27.391Z",
"errors": [
{
"field": "filters.Date_Range.start_date",
"message": "start_date is required"
},
{
"field": "filters.Date_Range.end_date",
"message": "end_date is required"
},
{
"field": "name",
"message": "name is required"
},
{
"field": "sort_by_column",
"message": "sort_by_column is required"
}
]
}
401 Response:
{
"timestamp": "2021-11-24T21:34:02.108Z",
"errors": [
"You are not authorized to access this resource"
]
}
403 Response:
{
"timestamp": "2021-11-24T21:34:02.108Z",
"errors": [
"You are not allowed to access this resource"
]
}
500 Response:
{
"timestamp": "2021-11-24T21:34:02.108Z",
"errors": [
"Oops, Something went wrong!"
]
}
Creates a new data request
Request
POST /v1/api/data-requests
Body Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Name of the data request. |
| sort_by_column | string | Yes | Column to sort by. |
| data_request_email | boolean | No | Enable email notification when data request completes. |
| data_update_email | boolean | No | Enable email notification when data update completes. |
| filters | object | Yes | Filters |
| columns | object | Yes | Columns |
Get Data Requests
import requests
url = "https://developer.staging.spikeet.com/v1/api/data-requests?page=1&limit=25"
headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"api-key": "{YOUR_API_KEY}"
}
response = requests.request("GET", url, headers=headers)
print(response.json())
curl --request GET \
--get "https://developer.staging.spikeet.com/v1/api/data-requests?page=1&limit=25" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--header "api-key: {YOUR_API_KEY}"
const url = new URL("https://developer.staging.spikeet.com/v1/api/data-requests?page=1&limit=25");
const headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"api-key": "{YOUR_API_KEY}",
};
fetch(url, {
method: "GET",
headers: headers
})
.then(response => response.json())
.then(json => console.log(json));
200 Response:
{
"result": [
{
"_id": "61702293f09be1aaa0851e25",
"user_id": "60e58159273da6672e1b5d91",
"subscription_id": "60e37c4c7426ae6a673e527d",
"folder_id": null,
"application_id": "60f7e1e473fbe65abef9a761",
"name": "Sample",
"status": "Finished",
"filters": {
"Technical": {
"Daily": [...],
"Intraday": [...]
},
"Custom": [...],
"Fundamental": [...],
"Identity": [...],
"Indicator": [...],
"Date_Range": {
"start_date": "2021-01-01T00:00:00.000Z",
"end_date": "2021-01-01T00:00:00.000Z"
}
},
"columns": {
"Technical": {
"Daily": [...],
"Intraday": [...]
},
"Custom": [...],
"Earnings": [...],
"Fundamental": [...],
"Indicator": [...],
"Identity": [...]
},
"sort_by_column": "date",
"download_allowed": false,
"identifier": "C4YlERmnGbHXJLeDl42Ve3BvN",
"type": {
"source": "Api",
"is_custom": false,
"triggered_by_special_permission": false,
"user_roles": []
},
"settings": {
"data_updates_output": {
"aws_upload": false,
"new_zoho_workbook": false,
"new_zoho_worksheet": false,
"new_zoho_worksheet_per_update": false,
"append_to_data_update_worksheet": false,
"append_to_data_request_worksheet": false
},
"data_request_email": {
"send_completed_email": true,
"send_failed_email": true,
"send_completed_email_to_admin": false,
"send_failed_email_to_admin": true
},
"data_update_email": {
"send_completed_email": true,
"send_failed_email": true,
"send_completed_email_to_admin": false,
"send_failed_email_to_admin": true
},
"webhook": {
"enable_data_update": true,
"enable_data_request": true
}
},
"duration": {
"start": "2021-01-01T00:00:00.000Z",
"end": "2021-01-01T00:00:00.000Z"
},
"custom_script": null,
"data_updates": {
"current": false,
"original": false
},
"zoho_permission": {
"view": true,
"edit": true,
"download": true
},
"created_at": "2021-01-01T00:00:00.000Z",
"last_update_date": "2021-01-01T00:00:00.000Z",
"updated_at": "2021-01-01T00:00:00.000Z",
"deleted_at": null,
"created_by": "user@email.com",
"deleted_by": null,
"__v": 0,
"output": {
"output": "",
"error": null
},
"aws_resource": {
"url": "https://spikeet-developer-data-request-staging.s3.amazonaws.com/user@email.com/C4YlERmnGbHXJLeDl42Ve3BvN/Sample.xlsx"
},
"id": "61702293f09be1aaa0851e25"
}
],
"metadata": {
"pagination": {
"page": 1,
"limit": 25,
"numberOfResults": 1,
"numberOfPages": 1
}
}
}
401 Response:
{
"timestamp": "2021-11-24T21:34:02.108Z",
"errors": [
"You are not authorized to access this resource"
]
}
403 Response:
{
"timestamp": "2021-11-24T21:34:02.108Z",
"errors": [
"You are not allowed to access this resource"
]
}
500 Response:
{
"timestamp": "2021-11-24T21:34:02.108Z",
"errors": [
"Oops, Something went wrong!"
]
}
Returns a list of your data requests. The object with the result property contains an array of the data request objects. If no data requests are available it will be empty.
Request
GET /v1/api/data-requests?page={page}&limit={limit}
Query Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| page | number | No | Page number. The default is 1. |
| limit | number | No | A limit on the number of records to be returned. The default is 25. |
Get Data Request By ID
import requests
url = "https://developer.staging.spikeet.com/v1/api/data-requests/61702293f09be1aaa0851e25"
headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"api-key": "{YOUR_API_KEY}"
}
response = requests.request("GET", url, headers=headers)
print(response.json())
curl --request GET \
--get "https://developer.staging.spikeet.com/v1/api/data-requests/61702293f09be1aaa0851e25" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--header "api-key: {YOUR_API_KEY}"
const url = new URL("https://developer.staging.spikeet.com/v1/api/data-requests/61702293f09be1aaa0851e25");
const headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"api-key": "{YOUR_API_KEY}",
};
fetch(url, {
method: "GET",
headers: headers
})
.then(response => response.json())
.then(json => console.log(json));
200 Response:
{
"_id": "61702293f09be1aaa0851e25",
"user_id": "60e58159273da6672e1b5d91",
"subscription_id": "60e37c4c7426ae6a673e527d",
"folder_id": null,
"application_id": "60f7e1e473fbe65abef9a761",
"name": "Sample",
"status": "Finished",
"filters": {
"Technical": {
"Daily": [...],
"Intraday": [...]
},
"Custom": [...],
"Fundamental": [...],
"Identity": [...],
"Indicator": [...],
"Date_Range": {
"start_date": "2021-01-01T00:00:00.000Z",
"end_date": "2021-01-01T00:00:00.000Z"
}
},
"columns": {
"Technical": {
"Daily": [...],
"Intraday": [...]
},
"Custom": [...],
"Earnings": [...],
"Fundamental": [...],
"Indicator": [...],
"Identity": [...]
},
"sort_by_column": "date",
"download_allowed": false,
"identifier": "C4YlERmnGbHXJLeDl42Ve3BvN",
"type": {
"source": "Api",
"is_custom": false,
"triggered_by_special_permission": false,
"user_roles": []
},
"settings": {
"data_updates_output": {
"aws_upload": false,
"new_zoho_workbook": false,
"new_zoho_worksheet": false,
"new_zoho_worksheet_per_update": false,
"append_to_data_update_worksheet": false,
"append_to_data_request_worksheet": false
},
"data_request_email": {
"send_completed_email": true,
"send_failed_email": true,
"send_completed_email_to_admin": false,
"send_failed_email_to_admin": true
},
"data_update_email": {
"send_completed_email": true,
"send_failed_email": true,
"send_completed_email_to_admin": false,
"send_failed_email_to_admin": true
},
"webhook": {
"enable_data_update": true,
"enable_data_request": true
}
},
"duration": {
"start": "2021-01-01T00:00:00.000Z",
"end": "2021-01-01T00:00:00.000Z"
},
"custom_script": null,
"data_updates": {
"current": false,
"original": false
},
"zoho_permission": {
"view": true,
"edit": true,
"download": true
},
"created_at": "2021-01-01T00:00:00.000Z",
"last_update_date": "2021-01-01T00:00:00.000Z",
"updated_at": "2021-01-01T00:00:00.000Z",
"deleted_at": null,
"created_by": "user@email.com",
"deleted_by": null,
"__v": 0,
"output": {
"output": "",
"error": null
},
"aws_resource": {
"url": "https://spikeet-developer-data-request-staging.s3.amazonaws.com/user@email.com/C4YlERmnGbHXJLeDl42Ve3BvN/Sample.xlsx"
},
"id": "61702293f09be1aaa0851e25"
}
401 Response:
{
"timestamp": "2021-11-24T21:34:02.108Z",
"errors": [
"You are not authorized to access this resource"
]
}
403 Response:
{
"timestamp": "2021-11-24T21:34:02.108Z",
"errors": [
"You are not allowed to access this resource"
]
}
404 Response:
{
"timestamp": "2021-11-24T21:34:02.108Z",
"errors": [
"Data request not found"
]
}
500 Response:
{
"timestamp": "2021-11-24T21:34:02.108Z",
"errors": [
"Oops, Something went wrong!"
]
}
Returns a data request with the given Id. If the id is not valid it will return a 404 error.
Request
GET /v1/api/data-requests/:id
URL Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Data request Id. |
Data Request.Filters
Fundamental
All examples are in JSON format
outstanding_shares: Outstanding shares of the company <= 100 Million shares (JSON)
{
"operator": "<=",
"value": 100000000,
"data_point": "outstanding_shares"
}
market_cap: Market cap of the company <= $50 Million
{
"operator": "<=",
"value": 50000000,
"data_point": "market_cap"
}
news: Company HAD news on current day between 00:00:00 and 23:59:59
{
"data_point": "news",
"value": true,
"n": 0,
"start_time": "00:00:00",
"end_time": "23:59:59"
}
earnings: Company DIDN'T HAVE earnings on next day between 12PM and 4PM
{
"data_point": "earnings",
"value": false,
"n": 1,
"start_time": "12:00:00",
"end_time": "16:00:00"
}
| Field | Type | Required | Description | Values |
|---|---|---|---|---|
| data_point | string | Yes | Data point to filter by | Possible values: outstanding_shares, market_cap, news, earnings |
| operator | string | Only for outstanding_shares or market_cap | Math operator | Possible values: =, !=, <, >, >=, <= |
| value | If outstanding_shares OR market_cap: float If news OR earnings: boolean |
Yes | Value to filter by (varies by data point) | If outstanding_shares or market_cap: any real number If news OR earnings: True or False |
| n | int | Only for news or earnings | Day of the data point (current=0) | Whole numbers like 0, 1, -1, etc' |
| start_time | string | Only for news or earnings | Beginning of first minute of time range | Any time in the day, format: HH:MM |
| end_time | string | Only for news or earnings | End of last minute of time range | Any time in the day, format: HH:MM |
Identity
code: Security type is COMMON-STOCK or ADR
{
"data_point": "code",
"operator": "=",
"value": ["STOCK-COMMON", "STOCK-ADR"]
}
symbol: Symbol is AAPL or GOOG or TSLA
{
"operator": "=",
"data_point": "symbol",
"value": ["AAPL", "GOOG", "TSLA"]
}
| Field | Type | Required | Description | Values |
|---|---|---|---|---|
| data_point | string | Yes | Data point to filter by | Possible values: code, symbol |
| operator | string[] | Yes | Math operator | Possible values: =, != |
| value | string | Yes | Value to filter by - varies by data point | If data point is code: ["STOCK-COMMON", "STOCK-ADR", "ETF", "UNIT", "WARRANT","BOND"]. If data point is symbol: [List of tickers]. |
Indicator
VWAP: Unadjusted VWAP price on current day between 10AM and 11AM <= $10
{
"type": "VWAP",
"start_time": "10:00:00",
"end_time": "11:00:00",
"n": 0,
"operator": "<=",
"value": 10,
"adjusted": false
}
OHLCVT: Adjusted average close price between today and 100 days ago > $100
{
"type": "AVG",
"offset": 0,
"n": 100,
"data_point": "close",
"operator": ">",
"value": 100,
"adjusted": true
}
OHLCVT: Adjusted high price on the day the volume shares is the highest between today and 2 years ago >= $200
{
"type": "MAX",
"offset": 0,
"n": 504,
"data_point": "high",
"data_point_to_evaluate": "volume",
"operator": ">=",
"value": 200,
"adjusted": true
}
| Field | Type | Required | Description | Values |
|---|---|---|---|---|
| type | string | Yes | Type of indicator. Can be VWAP or the function to apply. If non-VWAP and data_point_to_evaluate is not passed: function to apply on data_point If non-VWAP and data_point_to_evaluate is passed: function to apply on data_point_to_evaluate |
Can be VWAP OR: If non-VWAP and data_point_to_evaluate is not passed the possible values are: MAX, MIN, SUM, AVG. If non-VWAP and data_point_to_evaluate is passed the posible values are: MAX or MIN |
| data_point | string | Only for MAX, MIN, SUM, AVG types | Data point to filter by | Possible values: open, high, low, close, volume, num_trades |
| operator | string | Yes | Math operator | Possible values: =, !=, <, >, >=, <= |
| value | float | Yes | Value to filter by (varies by data point) | Any real number |
| n | int | Yes | If VWAP: Day of the data point (current=0) If NOT VWAP: Number of days to include in calculation starting from offset |
If VWAP: whole numbers like 0, 1, -1, etc' If not VWAP: whole positive numbers like 0, 1, 2, etc' |
| offset | int | Only for MAX, MIN, SUM, AVG types | Number of days back to start calculation. (previous day=1) | Whole positive numbers like 0, 1, 2, etc' |
| start_time | string | Only for VWAP types | Beginning of first minute of time range | Any time between 4AM-8PM, format: HH:MM |
| end_time | string | Only for VWAP types | End of last minute of time range | Any time between 4AM-8PM, format: HH:MM |
| adjusted | boolean | Yes | Whether to fetch real-unadjusted price or adjusted price | True OR False |
| data_point_to_evaluate | string | No (can only be used in non-VWAP types) | Data point to && to pull first data point | Possible values: open, high, low, close, volume, num_trades |
Date_Range
Example #1:
{
"start_date": "2021-01-01",
"end_date": "2021-01-31"
}
| Field | Type | Required | Description |
|---|---|---|---|
| start_date | string | Yes | Start date |
| end_date | string | Yes | End date |
Technical.Daily
exchange: Exchange is NASDAQ or NYSE or OTC
{
"data_point": "exchange",
"value": ["NASDAQ", "NYSE", "OTC"],
"operator": "=",
"n": -2,
"adjusted": false
}
OHLCVT: Adjusted open price on current day > $1
{ "data_point": "open", "value": 1, "operator": ">", "n": 0, "adjusted": true }
OHLCVT: Unadjusted close price on previous day < $5
{
"data_point": "close",
"value": 5,
"operator": "<",
"n": -1,
"adjusted": false
}
| Field | Type | Required | Description | Values |
|---|---|---|---|---|
| data_point | string | Yes | Data point to filter by | Possible values: exchange, open, high, low, close, volume, num_trades |
| operator | string | Yes | Math operator | Possible values: =, !=, <, >, >=, <= |
| value | If exchange: list[strings] If OHLCVT: float |
Yes | Value to filter by (varies by data point) | If exchange: NASDAQ, NYSE, OTC If OHLCVT: any real number |
| n | int | Yes | Day of the data point (current=0) | Whole numbers like 0, 1, -1, etc' |
| adjusted | boolean | Yes | Whether to fetch real-unadjusted or adjusted price | True OR False |
Technical.Intraday
time: Time of the highest high on current day between 09:30AM and 4PM < '11:00'
{
"data_point": "time",
"start_time": "09:30:00",
"end_time": "16:00:00",
"data_point_to_evaluate": "high",
"func": "MAX",
"n": 0,
"adjusted": false,
"operator": "<",
"value": "11:00:00"
}
OHLCVT: Adjusted total share volume on current day between 4AM and 09:30AM > 100,000
{
"start_time": "04:00:00",
"end_time": "09:30:00",
"data_point": "volume",
"func": "SUM",
"operator": ">",
"value": 100000,
"n": 0,
"adjusted": true
}
OHLCVT: Time of the highest high on current day between 09:30AM and 4PM < '11:00'
{
"start_time": "10:00:00",
"end_time": "11:00:00",
"data_point": "high",
"func": "MAX",
"operator": "<",
"value": 10,
"n": -1,
"adjusted": false
}
| Field | Type | Required | Description | Values |
|---|---|---|---|---|
| data_point | string | Yes | Data point to filter by | Possible values: time (only when data_point_to_evaluate is passed), open, high, low, close, volume, num_trades |
| operator | string | Yes | Math operator | Possible values: =, !=, <, >, >=, <= |
| value | If time: string If OHLCVT: float |
Yes | Value to filter by (varies by data point) | If time: any time between 4AM-8PM, format: HH:MM If OHLCVT: any real number |
| n | int | Yes | Day of the data point (current=0) | Whole numbers like 0, 1, -1, etc' |
| func | string | Yes | If data_point_to_evaluate is not passed: function to apply on data_point If data_point_to_evaluate is passed: function to apply on data_point_to_evaluate |
If data_point_to_evaluate is not passed the possible values are: FIRST, MAX, MIN, SUM, AVG, LAST If data_point_to_evaluate is passed the possible valus are: MAX or MIN |
| start_time | string | Yes | Beginning of first minute of time range | Any time between 4AM-8PM, format: HH:MM |
| end_time | string | Yes | End of last minute of time range | Any time between 4AM-8PM, format: HH:MM |
| adjusted | boolean | Yes | Whether to fetch real-unadjusted or adjusted price | True OR False |
| data_point_to_evaluate | string | No | Data point to evaluate to pull first data point | Possible values: open, high, low, close, volume, num_trades |
Custom
Adjusted close price on current day > adjusted close price on previous day
{
"Formula": [
{
"type": "data_point",
"data_point": "daily",
"n": 0,
"value": "close",
"adjusted": false
},
{ "type": "operator", "value": ">" },
{
"type": "data_point",
"data_point": "daily",
"n": -1,
"value": "close",
"adjusted": false
}
]
}
GAP% >= 20
GAP% = (adjusted open price on current day - adjusted close price on previous day ) / adjusted close price on previous day * 100
{
"Formula": [
{ "type": "operator", "value": "(" },
{
"type": "data_point",
"data_point": "daily",
"value": "open",
"n": 0,
"adjusted": true
},
{ "type": "operator", "value": "-" },
{
"type": "data_point",
"data_point": "daily",
"value": "close",
"n": -1,
"adjusted": true
},
{ "type": "operator", "value": ")" },
{ "type": "operator", "value": "/" },
{
"type": "data_point",
"data_point": "daily",
"value": "close",
"n": -1,
"adjusted": true
},
{ "type": "operator", "value": "*" },
{ "type": "number", "value": 100 },
{ "type": "operator", "value": ">=" },
{ "type": "number", "value": 20 }
]
}
| Field | Type | Required | Description | Values |
|---|---|---|---|---|
| tag | string | Yes | The tag for the formula to remember it in future | any string |
| Formula | list[objects] | Yes | The math formula to evaluate |
Data Request.Columns
Fundamental
All examples are in JSON format
outstanding_shares: Outstanding shares of the company
{
"name": "Outstanding Shares",
"data_point": "outstanding_shares"
}
market_cap: Market cap of the company
{
"name": "Market Cap",
"data_point": "market_cap"
}
news: Company's news on current day between 12PM and 4PM
{
"name": "News",
"data_point": "news",
"n": 0,
"start_time": "12:00:00",
"end_time": "16:00:00"
}
| Field | Type | Required | Description | Values |
|---|---|---|---|---|
| data_point | string | Yes | Data point to pull into spreadsheet | Possible values: outstanding_shares, market_cap, news |
| n | int | Only for news | Day of the data point (current=0) | Whole numbers like 0, 1, -1, etc' |
| start_time | string | Only for news | Beginning of first minute of time range | Any time in the day, format: HH:MM |
| end_time | string | Only for news | End of last minute of time range | Any time in the day, format: HH:MM |
| name | string | Yes | Name of the column in spreadsheet | Any string |
Identity
type: Security type
{
"data_point": "type",
"name": "Sec Type"
}
symbol: Symbol of ticker
{
"data_point": "symbol",
"name": "Symbol"
}
name: Company name
{
"data_point": "name",
"name": "Company name"
}
currency: Currency
{
"data_point": "currency",
"name": "Currency"
}
| Field | Type | Required | Description | Values |
|---|---|---|---|---|
| data_point | string | Yes | Data point to pull into spreadsheet | Possible values: code, symbol, currency, type |
| value | string | Yes | Name of the column in spreadsheet | Any string |
Indicator
VWAP: Unadjusted VWAP price on current day between 10AM and 11AM
{
"name": "VWAP",
"type": "VWAP",
"start_time": "10:00:00",
"end_time": "11:00:00",
"n": 0,
"adjusted": false
}
OHLCVT: Adjusted average close price between today and 100 days ago
{
"name": "100 MA",
"type": "AVG",
"offset": 0,
"n": 100,
"data_point": "close",
"adjusted": true
}
OHLCVT: Adjusted high price on the day the volume shares is the highest between today and 2 years ago >= $200
{
"name": "2yr_high_when_vol_high",
"type": "MAX",
"offset": 0,
"n": 504,
"data_point": "high",
"data_point_to_evaluate": "volume",
"adjusted": true
}
| Field | Type | Required | Description | Values |
|---|---|---|---|---|
| type | string | Yes | Type of indicator. Can be VWAP or the function to apply. If non-VWAP and data_point_to_evaluate is not passed: function to apply on data_point If non-VWAP and data_point_to_evaluate is passed: function to apply on data_point_to_evaluate |
Can be VWAP OR: If non-VWAP and data_point_to_evaluate is not passed the possible values are: MAX, MIN, SUM, AVG. If non-VWAP and data_point_to_evaluate is passed the posible values are: MAX or MIN |
| data_point | string | Only for MAX, MIN, SUM, AVG types | Data point to pull into spreadsheet | Possible values: open, high, low, close, volume, num_trades |
| n | int | Yes | If VWAP: Day of the data point (current=0) If NOT VWAP: Number of days to include in calculation starting from offset |
If VWAP: whole numbers like 0, 1, -1, etc' If not VWAP: whole positive numbers like 0, 1, 2, etc' |
| offset | int | Only for MAX, MIN, SUM, AVG types | Number of days back to start calculation. (previous day=1) | Whole positive numbers like 0, 1, 2, etc' |
| start_time | string | Only for VWAP types | Beginning of first minute of time range | Any time between 4AM-8PM, format: HH:MM |
| end_time | string | Only for VWAP types | End of last minute of time range | Any time between 4AM-8PM, format: HH:MM |
| adjusted | boolean | Yes | Whether to fetch real-unadjusted price or adjusted price | True OR False |
| data_point_to_evaluate | string | No (can only be used in non-VWAP types) | Data point to evaluate to pull first data point | Possible values: open, high, low, close, volume, num_trades |
| name | string | Yes | Name of the column in spreadsheet | Any string |
Earnings
Example #1:
{
}
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Name | |
| data_point | string | Data point |
Technical.Daily
exchange: Exchange that company is listed on current day
{
"name": "Exchange",
"data_point": "exchange",
"n": 0,
"adjusted": false
}
OHLCVT: Adjusted open price on current day
{
"n": 0,
"name": "Open",
"adjusted": true,
"data_point": "open"
}
OHLCVT: Unadjusted close price on previous day < $5vvvvvv
{
"n": -1,
"name": "Close",
"adjusted": false,
"data_point": "close"
}
| Field | Type | Required | Description | Values |
|---|---|---|---|---|
| data_point | string | Yes | Data point to pull into spreadsheet | Possible values: exchange, date, open, high, low, close, volume, num_trades |
| n | int | Yes | Day of the data point (current=0) | Whole numbers like 0, 1, -1, etc' |
| adjusted | boolean | Yes | Whether to fetch real-unadjusted or adjusted price | True OR False |
| name | string | Yes | Name of the column in spreadsheet | Any string |
Technical.Intraday
time: Time of the highest high on current day between 09:30AM and 4PM
{
"name": "Time of high",
"data_point": "time",
"start_time": "09:30:00",
"end_time": "16:00:00",
"data_point_to_evaluate": "high",
"func": "MAX",
"n": 0,
"adjusted": false
}
OHLCVT: Time of the highest high on current day between 09:30AM and 4PM
{
"name": "pm volume",
"data_point": "volume",
"start_time": "04:00:00",
"end_time": "09:30:00",
"func": "SUM",
"n": 0,
"adjusted": true
}
OHLCVT: Time of the highest high on current day between 09:30AM and 4PM
{
"name": "prev day high",
"data_point": "high",
"start_time": "10:00:00",
"end_time": "11:00:00",
"func": "MAX",
"n": -1,
"adjusted": false
}
| Field | Type | Required | Description | Values |
|---|---|---|---|---|
| data_point | string | Yes | Data point to pull into spreadsheet | Possible values: time (only when data_point_to_evaluate is passed), open, high, low, close, volume, num_trades |
| n | int | Yes | Day of the data point (current=0) | Whole numbers like 0, 1, -1, etc' |
| func | string | Yes | If data_point_to_evaluate is not passed: function to apply on data_point If data_point_to_evaluate is passed: function to apply on data_point_to_evaluate |
If data_point_to_evaluate is not passed the possible values are: FIRST, MAX, MIN, SUM, AVG, LAST If data_point_to_evaluate is passed the possible valus are: MAX or MIN |
| start_time | string | Yes | Beginning of first minute of time range | Any time between 4AM-8PM, format: HH:MM |
| end_time | string | Yes | End of last minute of time range | Any time between 4AM-8PM, format: HH:MM |
| adjusted | boolean | Yes | Whether to fetch real-unadjusted or adjusted price | True OR False |
| data_point_to_evaluate | string | No | Data point to evaluate to pull first data point | Possible values: open, high, low, close, volume, num_trades |
| operator | string | Yes | Name of the column in spreadsheet | Any string |
Custom
Adjusted close price on current day > adjusted close price on previous day
{
"name": "Closed Green?",
"Formula": [
{
"type": "data_point",
"data_point": "daily",
"n": 0,
"value": "close",
"adjusted": false
},
{ "type": "operator", "value": ">" },
{
"type": "data_point",
"data_point": "daily",
"n": -1,
"value": "close",
"adjusted": false
}
]
}
GAP%
GAP% = (adjusted open price on current day - adjusted close price on previous day ) / adjusted close price on previous day * 100
{
"name": "GAP%",
"Formula": [
{ "type": "operator", "value": "(" },
{
"type": "data_point",
"data_point": "daily",
"value": "open",
"n": 0,
"adjusted": true
},
{ "type": "operator", "value": "-" },
{
"type": "data_point",
"data_point": "daily",
"value": "close",
"n": -1,
"adjusted": true
},
{ "type": "operator", "value": ")" },
{ "type": "operator", "value": "/" },
{
"type": "data_point",
"data_point": "daily",
"value": "close",
"n": -1,
"adjusted": true
},
{ "type": "operator", "value": "*" },
{ "type": "number", "value": 100 }
]
}
| Field | Type | Required | Description | Values |
|---|---|---|---|---|
| tag | string | Yes | The tag for the formula to remember it in future | any string |
| name | string | Yes | Name of the column in spreadsheet | any string |
| Formula | list[objects] | Yes | The math formula to evaluate |
Errors
The Spikeet Developer API uses the following error codes:
| Error Code | Meaning |
|---|---|
| 400 | Bad Request -- Your request is invalid. |
| 401 | Unauthorized -- Your API key is wrong. |
| 403 | Forbidden -- The kitten requested is hidden for administrators only. |
| 404 | Not Found -- The specified kitten could not be found. |
| 405 | Method Not Allowed -- You tried to access a kitten with an invalid method. |
| 406 | Not Acceptable -- You requested a format that isn't json. |
| 429 | Too Many Requests -- You're requesting too many kittens! Slow down! |
| 500 | Internal Server Error -- We had a problem with our server. Try again later. |
| 503 | Service Unavailable -- We're temporarily offline for maintenance. Please try again later. |