What is the current streak of the value over time?
*Endpoint: https://generate-text-mrwwgrktvq-ue.a.run.app/streak-sentence
Description: Returns the current streak.
Call structure: The value column must be a numeric field with one of three options: -1, 0, or 1. The value for 1 should correspond to the text of the field positive_name; -1 should correspond to negative_name; and 0 should correspond to zero_name.
The example below refers to the performance of the Philadelphia 76ers (aka Sixers). If value is 1, it denotes a win; if value is 0 it denotes a tie (which will not occur, given NBA basketball does not have ties); if value is -1, it denotes a loss. This can then be used to construct the win/loss streak that the Sixers are on.
curl -XPOST -d '{
"post_body":{
"metric_df": [
{
"value": 1
"time": "2020-12-23",
"asset_id": "the Sixers",
"positive_name": "win",
"negative_name": "loss",
"zero_name": "tie"
},
{
"value": 1,
"time": "2020-12-21",
"asset_id": "the Sixers",
"positive_name": "win",
"negative_name": "loss",
"zero_name": "tie"
},
{
"value": 1,
"time": "2020-12-19",
"asset_id": "the Sixers",
"positive_name": "win",
"negative_name": "loss",
"zero_name": "tie"
},
{
"value": -1,
"time": "2020-12-17",
"asset_id": "the Sixers",
"positive_name": "win",
"negative_name": "loss",
"zero_name": "tie"
},
{
"value": -1,
"time": "2020-12-15",
"asset_id": "the Sixers",
"positive_name": "win",
"negative_name": "loss",
"zero_name": "tie"
}
],
"key": ["api_token_here"]
}
}' 'https://generate-text-mrwwgrktvq-ue.a.run.app/streak-sentence'
Sample API Response
This is the 3rd straight win for the Sixers.