Introduction
The Gatsiva API is a secured JSON over HTTP that allows cryptocurrency traders and analysts to quickly analyze and monitor certain technical events happening over hourly and daily data on multiple cryptocurrencies. It is provided as a JSON over HTTP API with a simple authentication layer, and intended to be utilized by traders, researchers, and enthusiasts for tracking and analyzing price movements within cryptocurrencies.
This API uses the Gatsiva Language Definition format. The format is a basic, human-readable statement that allows users to quickly assemble rules to analyze. Documentation regarding the language can be found below.
In this documentation, we have provided language bindings in Shell and Python. You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.
Requesting Access
Access to the Gatsiva API is limited to collaborators and beta testers only at this time. To request access to this API, please visit our Gatsiva Collaboration Site. After being approved to our site, you can request API access with the instructions listed in the discussion.
Authentication
To authenticate your request, use this code:
import requests
my_headers = {'Accept': 'application/json', 'Authorization': 'Bearer <token>'}
response = requests.get('https://api.gatsiva.com/api/v1/symbols',headers=my_headers)
curl "https://api.gatsiva.com/api/v1/symbols"
-H "Authorization: Bearer <token>"
-H "Accept: application/json"
Make sure to replace
<token>
with your API key.
This API is protected utilizing the Bearer authentication scheme defined in RFC6750. Gatsiva expects for the API key to be included in all API requests to the server in a header that looks like the following:
Authorization: Bearer <token>
Gatsiva Language Definition
Throughout the Gatsiva set of services, Gatsiva uses a condition definition format that utilizes a human-readable language. The format is a basic, human-readable statement that allows users to quickly assemble interesting rules to analyze.
The current version of the Gatsiva Language Definition that is utilized for the API is version 1.11.
Revisions
Version 1.12
- Added support for
atr
- Average True Rangeadx
- Average Directional Indexadl
- Advance / Decline Line
Version 1.11
- Added support for equality comparators including
=
|is equal to
|equals
!=
|is not equal to
|does not equal
Version 1.10
- Added on balance volume
obv
andvolume
- Added support for
over 1 period
without an s on periods forslope
Version 1.9
- Added
is within x%
,ichimoku
, andretracement
Version 1.8
- Stochastic indicators no longer fail with a division by zero error when the highest high and lowest low are the same value.
price change
indicator now allows up to 1000 periods
Version 1.7
- To account for hourly symbol data, we have revised allowable ranges of some indicators.
Version 1.6
- Removed ability for bollinger bands to have
1
as a period argument.
Version 1.5
- Updated standard deviation information to clarify that calculation used population variance.
Basic Rule Construction
Each valid Gatsiva condition must have a comparator which compares two sides of the defined rule as follows: A (some comparator) B. From this A and B can be expressed as even further nested conditions or simple truth tests using other comparators. The valid list of comparators appears below.
Valid Comparators
Note: Valid comparators are shown in code and A and B are placeholders for more complex expressions
Expression | Definition |
---|---|
A and B |
returns true if both A and B expressions are true |
A or B |
returns true if either A or B expression are true |
A is greater than B A > B |
returns true if A is greater than B |
A is less than B A < B |
returns true if the B is greater than A |
A is positive |
returns true if A is greater than zero |
A is negative |
returns true if A is less than zero |
A equals B A is equal to B A = B |
returns true if A is the same value as B |
A does not equal B A is not equal to B A != B |
returns true if A is not the same value as B |
A crosses above B |
returns true if the A value crosses up and over the B value |
A crosses below B |
returns true if the A value crosses down and over the B value |
A crosses B |
returns true if the A value crosses up or down the B value (in other words, it works bi-directionally) |
A is within <x>% of B |
returns true if the A value is within x percent of the B value (Note: x must be a value between 0 and 100 non-inclusive) |
Examples of Valid Comparators
Example | Meaning |
---|---|
sma(15) is greater than 5 |
Returns true if the 15 period simple moving average is greater than 5 |
sma(15) is greater than 5 AND sma(15) crosses below 8 |
Will only returns true if the 15 period simple moving average is greater than 5 and the 15 period simple moving average just crossed below 8 |
close(1) is within 10% of sma(50) |
Will return true if the closing prices is within +/- 10% of the value of the 50-period moving average. |
Chaining Logical Operators
Please note that at present, you can only chain together AND comparators or OR comparators. You cannot mix the two. For example in the following examples where [a], [b], and [c] are expressions, [a] AND [b] AND [c] is allowed, [a] OR [b] OR [c] is allowed, but [a] AND [b] OR [c] will result in a formatting error being returned for that condition.
Indicator Expressions
Indicators are expressions that resolve to a number value and can be used on either side of a greater than, less than, crosses above, crosses below, or crosses comparator. This of course makes sense because you are comparing two things that need to have some values specified before we compare them.
Gatsiva supports multiple categories of indicator expressions as follows. In the list below, you can see the indicators that we currently support.
Indicator | Explanation |
---|---|
Value Indicators | These are indicators that return a value or set of values |
Math Indicators | These indicators allow you to perform mathematical calculations on other indicators |
Technical Indicators | These indicators allow you to quickly calculate some common technical indicators utilized for stock trading |
Period Modifiers | These are indicators that allow you to easily get values from in the past |
Value Indicators
Note: In the following cases n must be an integer between 0 and 1000.
Expression | Definition |
---|---|
open(n) |
The opening price over n periods |
high(n) |
The high price over n periods |
low(n) |
The low price over n periods |
close(n) |
The closing price over n periods |
volume(n) |
The volume over n periods |
price change percentage(n) |
The change in price value over n periods (0.5 would represent 50%) |
price range percentage(n) |
Returns where the current price is within the price range over the last n periods as a decimal value between 0 and 1 |
retracement(n) |
Returns the % retracement from the highest high or lowest low within n periods. This value will be between 0 and 1 for positive retracements and between -1 and 0 for negative retracements. For example: If the price fell from a high of 10 to 8 within n periods, the retracement would be -0.2. |
(any number) |
Example: 2 , 3,5 , etc - To utilize numbers, simply just write the number |
For the aforementioned expressions, n
can be any number between 1
and 1000
. Note also that open, high, low, close, and volume return a sequence of numbers if given an n
value greater than 1 so they can be used with other mathematical operations like average of
and standard deviation of
which are outlined below.
Examples of Valid Value Indicators:
Example | Meaning |
---|---|
close(1) is greater than 50 | Returns true if the last closing price is greater than 50 |
high(5) is greater than 25 | Returns true if the last 5 high prices are all greater than 25 |
close(3) is greater than open(3) | Returns true if each of closing prices were higher than their respective opening prices in the last 3 periods |
close(1) is greater than average of open(10) | Returns true if the most recent closing price is higher than the average of the last 10 opening prices |
Mathematical Indicators
Expression | Definition |
---|---|
A plus B |
Adds A and B |
A minus B |
Subtracts B from A |
A times or multiplied by B |
Multiplies A and B |
A divided by B |
Divides A by B |
average of A |
Takes the average of A (Note that this will only work where A is multiple values like high(n) or close(n) where n is greater than 1) |
maximum of A |
Returns the maximum value of A |
minimum of A |
Returns the minimum value of A |
standard deviation of A |
Returns the standard deviation of A using population variance |
absolute value of A |
Returns the absolute value of A |
A to the n power |
Returns A raised to the n exponent |
the square root of A |
Returns the square root of A |
slope of A over n periods |
Returns the slope of the values for expression A over the last n periods |
Examples of Valid Mathematical Operators:
With these simple mathematical operations, some complex rule definitions can begin to emerge.
Example | Meaning |
---|---|
average of close(15) is greater than average of close(10) | Returns true of the average of the closing price for the last 15 periods is greater than the average of the closing price for the last 10 periods |
slope of sma(15) over 5 periods is greater than 0 | Returns true of the slope for the 15-period simple moving average as measured over the last 5 periods is positive |
close(1) is greater than close(1) plus 2 times standard deviation of close(10) | Returns true if the closing price is greater than 2 times the standard deviation of the last 10 days plus the current closing price |
Technical Indicators
Note: This documentation is not meant to be an overview of the calculation methodology for these indicators themselves. For that, please refer to an authoritative source like Stockcharts.com for calculations and examples. Also, please note that these indicators vary in their inputs as necessary for each indicator.
https://stockcharts.com/school/doku.php?id=chart_school:market_indicators:ad_line
Expression | Definition |
---|---|
adl(n) |
Returns the advance decline line index over n periods. Reference |
adx(n) |
Returns the average directional index over n periods. Reference |
atr(n) |
Returns the average true range over n periods. Reference |
aroon up(n) |
Returns the Aroon Up value over n periods. Reference |
aroon down(n) |
Returns the Aroon Down value over n periods. Reference |
aroon osc(n) |
Returns the value for the Aroon Oscillator over n periods. Reference |
bollinger range(p,s) |
Where p is the number of periods and s is the number of standard deviations to utilize for the calculation, this returns where within the range of a bollinger band the current closing price is. If the return value is 0 or lower that indicates the price is below the lower band, 1 or higher indicates the closing price is above the upper band. Reference |
upper bollinger band(p,s) |
Returns the value of the upper bollinger band where p is the number of periods and s is the number of standard deviations. Reference |
lower bollinger band(p,s) |
Returns the value of the lower bollinger band where p is the number of periods and s is the number of standard deviations. Reference |
ema(n) |
Returns the exponential moving average over n periods. Reference |
full stochastics k(k,x,d) |
Returns the fast stochastic oscillator utilizing k for the periods and x as smoothing value. Reference |
full stochastics d(k,x,d) |
Returns the slow stochastic oscillator utilizing k for the periods and x as smoothing value along with an additional smoothing parameter d. Reference |
ichimoku conversion(c,b,l,d) |
Returns the value of the conversion line (tenkan-sen) for Ichimoku clouds where c is the conversion period, b is the base period, l is the lagging span period, and d is the displacement. Reference |
ichimoku base(c,b,l,g) |
Returns the value of the base line (kijun-sen) for Ichimoku clouds where c is the conversion period, b is the base period, l is the lagging span period, and d is the displacement. Reference |
ichimoku lead-a(c,b,l,g) |
Returns the value of the leading span A line (senkou span a) for Ichimoku clouds where c is the conversion period, b is the base period, l is the lagging span period, and d is the displacement. Reference |
ichimoku lead-b(c,b,l,g) |
Returns the value of the leading span B line (senkou span b) for Ichimoku clouds where c is the conversion period, b is the base period, l is the lagging span period, and d is the displacement. Reference |
macd line(s,l,m) |
Returns the MACD line which is the difference between the s period EMA and the l period SMA. Note that in this case the m parameter is ignored. Reference |
macd signal(s,l,m) |
Returns the MACD signal which is the m period EMA of the macd line defined above. Reference |
macd histogram(s,l,m) |
Returns the MACD histogram which is the difference between the line and signal values defined above. Reference |
mfi(n) |
Returns the Money Flow Index over n periods. Note that money flow is calculated using the volume in the denominated currency. Reference |
obv(n) |
Returns the On Balance Volume. If 1 is given for n, then a single value is returned. If n>1 then an array of values is returned that can be used with mathematical indicators like minimum of and average of . Note that on balance volume is calculated using the volume in the denominated currency. Also note that on balance volume is calculated using ALL available data, not the specific time frame of analysis. Reference |
rsi(n) |
Returns the relative strength index over n periods. Reference |
sma(n) |
Returns the simple moving average over n periods. Reference |
Period Modifiers
The following period modifiers can be added after any value indicator to "delay" the period being evaluated. Since the symbol definition determines the time period of daily or hourly, we simply refer generically to periods to offset a calculation.
The following two methods are considered valid
Expression | Definition |
---|---|
A n periods ago |
Returns the value of expression A as of n periods ago |
A 1 period ago |
Returns the value of expression A as of 1 period ago |
Examples of Valid Period Modifiers
Example | Meaning |
---|---|
sma(15) is < sma(15) 5 periods ago | Returns true if the 15-period sma at present is less than the 15-period sma as of 5 periods ago. |
close(1) minus close(1) 24 periods ago is greater than 0 | Returns true if the current closing price is greater than the closing price 24 periods ago. |
Timestamps
Timestamp Definition
To avoid confusion, all timestamps in the Gatsiva API are given as Unix time - defined as the number of seconds that have elapsed since 00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January 1970.
Many modern programming languages support conversion from Unix time to other formats. For examples, please see our example Jupyter Notebooks.
Timestamp Periods
It is important to know that the timestamp values that are given in the responses also indicate the timestamp at which the period starts.
For example, if you were using BTC:USD:daily
data and the timestamp returned was 1516060800, that would represent market data for the time period between 2018-01-16 00:00:00 UTC and 2018-01-17 00:00:00 UTC. So the opening price would be the price observed at midnight UTC on the 16th and the closing price would be the price observed at midnight UTC on the 17th.
Symbols and Prices
Symbol Definition
This API uses a convention for any symbol
input that must be adhered to. Symbols must be formed with three parts concatenated with a colon like: BTC:USD:daily
The first part of the symbol definition is the cryptocurrency symbol you actually want to take a look at. The second symbol is the symbol in which the first symbol is valued. The third symbol is the time frequency that is utilized for the evaluation. At present only the daily
and hourly
time frequencies are supported. Please see the following examples with their meanings for a reference.
Symbol | Meaning |
---|---|
BTC:USD:daily |
Bitcoin priced in US dollars on a daily basis |
ETH:EUR:hourly |
Ethereum priced in Euros on an hourly basis |
ETH:BTC:daily |
Ethereum priced in Bitcoin on a daily basis |
For a list of available symbol components that can utilized within the API for the first and second component parts, you can execute the /symbols
transaction in the API.
Get All Symbols
import requests
my_headers = {'Accept': 'application/json', 'Authorization': 'Bearer <token>'}
response = requests.get('https://api.gatsiva.com/api/v1/symbols',headers=my_headers)
curl "https://api.gatsiva.com/api/v1/symbols"
-H "Authorization: Bearer <token>"
-H "Accept: application/json"
The above command returns JSON structured like this:
[
{
"symbol": "BTC",
"name": "Bitcoin"
},
{
"symbol": "ETH",
"name": "Ethereum"
}
]
This endpoint retrieves all symbols available to the Gatsiva API.
HTTP Request
GET https://api.gatsiva.com/api/v1/symbols
Query Parameters
None
Get Symbol Price Data
import requests
my_headers = {'Accept': 'application/json', 'Authorization': 'Bearer <token>'}
response = requests.get('https://api.gatsiva.com/api/v1/symbols/BTC:USD:daily',headers=my_headers)
curl "https://api.gatsiva.com/api/v1/symbols/BTC:USD:daily"
-H "Authorization: Bearer <token>"
-H "Accept: application/json"
The above command returns JSON structured like this:
{
"symbol": "BTC:USD:daily",
"results": [
{
"1505462664": {
"open": 4203.02,
"high": 4302.11,
"low": 3990.02,
"close": 4102.88,
"volume": 123012312
}
},
{
"1505549064": {
"open": 4203.02,
"high": 4302.11,
"low": 3990.02,
"close": 4102.88,
"volume": 123012312
}
},
{
"1505635464": {
"open": 4203.02,
"high": 4302.11,
"low": 3990.02,
"close": 4102.88,
"volume": 123012312
}
},
{
"1505721864": {
"open": 4203.02,
"high": 4302.11,
"low": 3990.02,
"close": 4102.88,
"volume": 123012312
}
}
]
}
This endpoint retrieves price information for a specific currency pair, returns the market data available for the given symbol in a hashmap with the key as the UNIX timestamp which begins the period of capture.
HTTP Request
GET https://api.gatsiva.com/api/v1/symbols/<SYMBOL_ID>
URL Parameters
Parameter | Description |
---|---|
SYMBOL_ID | The symbol you wish to retrieve pricing information for. |
Conditions
Condition Status
import requests
request_data = { 'symbol': 'BTC:USD:daily', 'at_timestamp': 1505721864, 'conditions': [ 'bollinger range(20,2) crosses below 0', 'sma(28) crosses sma(14)' ] }
my_headers = {'Accept': 'application/json', 'Authorization': 'Bearer <token>'}
response = requests.post('https://api.gatsiva.com/api/v1/conditions/status', json=request_data, headers=my_headers)
curl "https://api.gatsiva.com/api/v1/conditions/status"
-H "Accept: application/json"
-H "Content-Type: application/json"
-H "Authorization: Bearer <token>"
-d '{"symbol":"BTC:USD:daily","at_timestamp":1505721864,"conditions":["bollinger range(20,2) crosses below 0","sma(28) crosses sma(14)"]}'
The above command returns JSON structured like this:
{
"symbol": "BTC:USD:daily",
"last_timestamp": 1505721864,
"conditions": [
{
"definition": "bollinger range(20,2) crosses below 0",
"value": true
},
{
"definition": "sma(28) crosses sma(14)",
"value": false
}
]
}
Returns whether or not a list of conditions are true or false and the last timestamp they were evaluated at.
HTTP Request
POST https://api.gatsiva.com/api/v1/conditions/status
Input Parameters
Parameter | Type | Description |
---|---|---|
symbol | required | The symbol to evaluate |
conditions | required | The list of conditions to evaluate |
at_timestamp | optional | The timestamp at which to evaluate the rules |
The last_timestamp
field in the response shows the actual last market timestamp utilized for the evaluation.
Condition History
import requests
request_data = { 'symbol': 'BTC:USD:daily', 'condition': 'sma(28) crosses sma(14)' }
my_headers = {'Accept': 'application/json', 'Authorization': 'Bearer <token>'}
response = requests.post('https://api.gatsiva.com/api/v1/conditions/history', json=request_data, headers=my_headers)
curl "https://api.gatsiva.com/api/v1/conditions/history"
-H "Accept: application/json"
-H "Content-Type: application/json"
-H "Authorization: Bearer <token>"
-d '{"symbol":"BTC:USD:daily","condition":"sma(28) crosses sma(14)"}'
The above command returns JSON structured like this:
{
"symbol": "BTC:USD:daily",
"condition": "bollinger range(20,2) crosses below 0",
"results": [
{
"1505462664": false
},
{
"1505549064": true
},
{
"1505635464": false
},
{
"1505721864": false
}
]
}
Returns the history of a condition's evaluation over all available market dates.
HTTP Request
POST https://api.gatsiva.com/api/v1/conditions/history
Input Parameters
Parameter | Type | Description |
---|---|---|
symbol | required | The symbol to evaluate |
condition | required | The condition to evaluate |
Condition Return Profile
import requests
request_data = { 'symbol': 'BTC:USD:daily', 'returns_symbol': 'ETH:USD:daily', 'condition': 'price change percentage(1) < -0.05', 'periods':200, 'from': '2016-01-01', 'to': '2017-02-01'}
my_headers = {'Accept': 'application/json', 'Authorization': 'Bearer <token>'}
response = requests.post('https://api.gatsiva.com/api/v1/conditions/return_profile', json=request_data, headers=my_headers)
curl "https://api.gatsiva.com/api/v1/conditions/return_profile"
-H "Accept: application/json"
-H "Content-Type: application/json"
-H "Authorization: Bearer <token>"
-d '{"symbol":"BTC:USD:daily","returns_symbol":"ETH:USD:daily","condition":"price change percentage(1) < -0.05","periods":200,"from":"2016-01-01","to":"2017-02-01"}'
The above command returns JSON structured like this:
{
"symbol": "BTC:USD:daily",
"returns_symbol": "ETH:USD:daily",
"condition": "price change percentage(1) < -0.05",
"periods": 200,
"from_ts": 1464739200,
"to_ts": 1506038400,
"results": [
{
"returnperiod": 1,
"min": -0.012336,
"p25th": -0.003798,
"median": 0.009231,
"mean": 0.009842,
"p75th": 0.023482,
"max": 0.033241,
"n": 4,
"stddev": 0.016435
},
{
"returnperiod": 2,
"min": -0.039451,
"p25th": -0.037794,
"median": -0.021916,
"mean": -0.0014,
"p75th": 0.034994,
"max": 0.077683,
"n": 4,
"stddev": 0.047298
}
]
}
Returns the profile of returns after the condition occurs.
HTTP Request
POST https://api.gatsiva.com/api/v1/conditions/return_profile
Input Parameters
Parameter | Type | Description |
---|---|---|
symbol | required | The symbol to evaluate |
returns_symbol | optional | The symbol to use for calculating returns |
condition | required | The condition to evaluate |
periods | required | The number of periods after the event occurs up to which to evaluate |
from | optional | The date from which to perform the analysis |
to | optional | The date up to which to perform the analysis |
Output Parameters
The profile of returns is defined as sets of return data that exist at each period after an event occurs. Within that period, the following values are calculated based on all of the returns that have occurred.
For example, if an event occurred 30 times, the data for group with returnperiod
1 would represent the minimum, maximum, average, etc gain / loss in price 1 period after the event occurred. The data in the returnperiod
2 would represent the same two periods after the event occurred.
Parameter | Description |
---|---|
returnperiod | The number of periods that have elapsed since the event occurred |
min | The minimum return observed |
p25th | The 25th percentile of returns |
median | The median of return values |
mean | The average of all returns. |
p75th | The 75th percentile of returns |
max | The maximum return observed |
n | The number of observations found |
stddev | The standard deviation of returns |
Condition Returns (All)
import requests
request_data = { 'symbol': 'BTC:USD:daily', 'returns_symbol': 'ETH:USD:daily', 'condition': 'bollinger range(20,2) crosses below 0', 'periods':10, 'from': '2017-06-01', 'to': '2017-11-01'}
my_headers = {'Accept': 'application/json', 'Authorization': 'Bearer <token>'}
response = requests.post('https://api.gatsiva.com/api/v1/conditions/all_returns', json=request_data, headers=my_headers)
curl "https://api.gatsiva.com/api/v1/conditions/all_returns"
-H "Accept: application/json"
-H "Content-Type: application/json"
-H "Authorization: Bearer <token>"
-d '{"symbol":"BTC:USD:daily","returns_symbol":"ETH:USD:daily","condition":"bollinger range(20,2) crosses below 0","periods":10,"from":"2017-06-01","to":"2017-11-01"}'
The above command returns JSON structured like this:
{
"symbol": "BTC:USD:daily",
"returns_symbol": "ETH:USD:daily",
"condition": "bollinger range(20,2) crosses below 0",
"periods": 10,
"from_ts": 1496275200,
"to_ts": 1509494400,
"results": {
"1499644800": {
"1": -0.0084171636760779,
"2": 0.025200296925794,
"3": 0.0078582947244478,
"4": -0.046863934608066,
"5": -0.15739626794993,
"6": -0.18341567051476,
"7": -0.047196696273923,
"8": -0.010149230808611,
"9": -0.026211380448972,
"10": 0.22269434561139
},
"1499990400": {
"1": -0.11596700340619,
"2": -0.14326573179301,
"3": -0.00034912294051044,
"4": 0.038519897769641,
"5": 0.021668001987315,
"6": 0.28281196148905,
"7": 0.19734845602618,
"8": 0.26961242877668,
"9": 0.23384075517978,
"10": 0.23688886700654
},
"1505260800": {
"1": -0.16205762358893,
"2": -0.040443997736604,
"3": -0.044278335731948,
"4": -0.046683840229027,
"5": 0.059424487570699,
"6": 0.0097331207738955,
"7": 0.003066953639133,
"8": -0.065374946063473,
"9": -0.069622689772601,
"10": -0.021256805045617
}
}
}
Returns all of the returns for each period after an event ocurrs.
HTTP Request
POST https://api.gatsiva.com/api/v1/conditions/all_returns
Input Parameters
Parameter | Type | Description |
---|---|---|
symbol | required | The symbol to evaluate |
returns_symbol | optional | The symbol to use for calculating returns |
condition | required | The condition to evaluate |
periods | required | The number of periods after the event occurs up to which to evaluate |
from | optional | The date from which to perform the analysis |
to | optional | The date up to which to perform the analysis |
Output Parameters
The results data structure are organized by the timestamp at which each event occurred. Within each timestamp array, the returns are structured as 1 through N depending on the number of periods requested. The return in field 1 indicates the return 1 period after the event, 2 indicates the return 2 periods after the event, and so on.
Indicators
Indicator Status
import requests
request_data = { 'symbol': 'BTC:USD:daily', 'indicators': ['bollinger range(20,2)','close(1)','price change percentage(28)']}
my_headers = {'Accept': 'application/json', 'Authorization': 'Bearer <token>'}
response = requests.post('https://api.gatsiva.com/api/v1/indicators/status', json=request_data, headers=my_headers)
curl "https://api.gatsiva.com/api/v1/indicators/status"
-H "Accept: application/json"
-H "Content-Type: application/json"
-H "Authorization: Bearer <token>"
-d '{"symbol":"BTC:USD:daily","indicators":["bollinger range(20,2)","close(1)","price change percentage(28)"]}'
The above command returns JSON structured like this:
{
"symbol": "BTC:USD:daily",
"last_timestamp": 1505721864,
"indicators": [
{
"indicator": "bollinger range(20,2)",
"value": "0.8901"
},
{
"indicator": "close(1)",
"value": "386.23"
},
{
"indicator": "price change percentage(28)",
"value": "0.67342"
}
]
}
Returns the current value for a list of expressions (indicators)
HTTP Request
POST https://api.gatsiva.com/api/v1/indicators/status
Input Parameters
Parameter | Type | Description |
---|---|---|
symbol | required | The symbol to evaluate |
indicators | required | An array of indicators to evaluate |
Errors
The Gatsiva API uses the following error codes:
Error Code | Meaning |
---|---|
401 | Unauthenticated -- The requestor is not authenticated. |
403 | Unauthorized -- The requestor is not authorized to access that transaction. |
404 | Not Found -- The requested transaction cannot be found. |
422 | Invalid Request -- Your input is incorrect and needs to be corrected before proceeding. |
429 | Too Many Requests -- You're requesting too many transactions. |
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. |
Standard Error Message Format
{
"message": "The requestor is not authenticated"
}
A JSON message will be returned with each error code showing the reason for the error.
Validation Error Message Format
{
"message": "The given data was invalid",
"errors": {
"email": [
"The email field is required.",
"The email field must be shorter than 191 characters."
],
"password": [
"The password field is required."
]
}
}
If your input is invalid, more detail will be provided for error code 422 messages. A JSON array called errors
will be provided along with detail for each field in a subarray.