OpLab API (2.0)

Download OpenAPI specification:Download

Introdução

A API é uma solução que permite acesso aos dados de informações relacionadas ao aplicativo Oplab, onde você possui o acesso ao portfólio, gráficos, posições, entre outras informações. Ela é de uso individual, os dados obtidos pela API não pode ser distribuidos sem prévia autorização e seu uso está vinculada aos termos de serviços da Oplab que pode ser obtido no rodapé do website ou neste link direto https://www.oplab.com.br/termos-de-servico

Autenticação

Para fazer as chamadas na API, é necessário que você esteja autenticado com sua conta do Oplab. Estar autenticado, significa passar um header do tipo Access-Token em cada request.

Uma vez que você já possua cadastro no Oplab, existem duas formas para se obter esse Access-Token:


Via HTTP Request
"curl -X post -d '{"email": "exemplo@exemplo.com.br", "password": "exemplo123"}' https://api.oplab.com.br/v2/users/authenticate"

O Access-Token tem TTL de 2 semanas. Após esse período, será necessário renová-lo com

curl -X GET -H 'Access-Token: P85w4/j6vYELJpQdRI9JtLhGxpvj2aAqVmB5ARnLHFnRS6wg9USK/+aWm2WTcj7N6ovN8pgPQH6uQVUkQBsXGQ==--TCJMJ5UFzrkb91z21smXw==--YpYFE5c+anh2+xfMBjIrSQ==' 'https://api.oplab.com.br/v2/users/authorize'

Pessoas

Autorização

Request body description

header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

get/users/authorize
https://api.oplab.com.br/users/authorize

Request samples

Copy
curl -i -X GET -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/users/authorize'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "Desenvolvedor Oplab",
  • "id": 10518,
  • "preferences": { },
  • "email": "dev@oplab.com.br",
  • "last-login": "2019-03-26T00:35:02.243Z",
  • "category": "MAX",
  • "access-token": "tupYCgGeXK441+jaRX+owrVt1Rp2d+jBAvNoppf4XEB4puIgI2qW2keqByq7e4MqVIMJKTNtDtnVosMJMBmAMA==--uzF4yHkdKNh+M5urrosiVg==--P3I//V6qx7bxNlQhito1QA==",
  • "data-access": "REAL_TIME",
  • "display-name": "Desenvolvedor Oplab",
  • "versions":
    {
    },
  • "days-to-expiration": 54,
  • "datafeed-access-token": "np7ITttANtKQolkC1ys+FafO3KpGu2PT3ouUr1TA+0bwb7XrDYyRxX6UtP1S2L0df0qD1Cbx/NxUm6tUXtuVbQ==--mCOjry5sgY0l1ynDPeIFBQ==--ZKOM2Kp2aH3KWcX"
}

Autenticação

Endpoint description

header Parameters
Email
required
string
Example: exemplo@exemplo.com.br
Senha
required
string
Example: exemplo123

Responses

200

OK

post/v2/users/authenticate
https://api.oplab.com.br/v2/users/authenticate

Request samples

Copy
curl -i -X POST -d {"email": "exemplo@exemplo.com.br", "password": "exemplo123 "}"https://api.oplab.com.br/v2/users/authenticate"

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "access-token": "idRiRrQ5+XfCbOq/S0alOSx+Gz5gosvNK9R8838PeP9pc426fD6BzceEWkx20YHJoGXncmaUfVih/CwRx7FXVA==--WCljLkMdPa9PU0/27UDjSQ==--nikje9cSbF0fHtjlaZxahQ==",
  • "category": "MAX",
  • "data-access": "REAL_TIME",
  • "datafeed-access-token": "M0zRluxYaeL2q2HELb6hrJDS6dG84DJ0l581MFzrdW+F0UPQrqkKb0eov7vp/7D4yi0vK6hGHla1zS8TY3Ymfg==--2ZuhPW2yEvKEo2I+QVD9Jw==--Eyc+GYA7CnCvkt0g5QcD7w==",
  • "days-to-expiration": 49,
  • "display-name": "Desenvolvedor Oplab",
  • "email": "dev@oplab.com.br",
  • "id": "10518,",
  • "last-login": "2019-03-26T00:35:02.243Z",
  • "name": "Desenvolvedor Oplab",
  • "preferences": { },
  • "versions":
    {
    }
}

Atualizar configurações

Endpoint description

header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe
Request Body schema: application/json
spot_symbol
string
brokerage
integer
interest_rate
number
is_notifications_enabled
boolean
name
string
orders_attributes
string

Responses

200

OK

post/v2/users/settings
https://api.oplab.com.br/v2/users/settings

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "preferences":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{ }

Análise de Opções

Carregar uma análise de um determinado ativo

Endpoint description

path Parameters
symbol
required
string
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

get/v2/studies/:symbol
https://api.oplab.com.br/v2/studies/:symbol

Request samples

Copy
curl -i -X GET -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/studies/:symbol'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": 60407,
  • "target": null,
  • "symbol": "PETR4",
  • "time": 1573171237000,
  • "prefix": "PETR",
  • "open": 30.45,
  • "name": "PETROBRAS PN",
  • "high": 30.79,
  • "low": 30.2,
  • "close": 30.65,
  • "volume": 25016600,
  • "variation": -0.81,
  • "financial-volume": 762476177,
  • "iv-1y-min": 25.38,
  • "iv-1y-max": 51.77,
  • "iv-1y-rank": 12.807881773399021,
  • "iv-1y-percentile": 22.22,
  • "iv-6m-min": 25.38,
  • "iv-6m-max": 37.09,
  • "iv-6m-rank": 28.864218616567044,
  • "iv-6m-percentile": 42.06,
  • "iv-current": 28.76,
  • "ewma-1y-min": 28.78,
  • "ewma-1y-max": 54.51,
  • "ewma-1y-rank": 1.91,
  • "ewma-1y-percentile": 1.98,
  • "ewma-6m-min": 28.78,
  • "ewma-6m-max": 41.7,
  • "ewma-6m-rank": 3.8,
  • "ewma-6m-percentile": 3.97,
  • "ewma-current": 29.27,
  • "short-term-trend": -1,
  • "middle-term-trend": 1,
  • "portfolio":
    {
    },
  • "sector": "Petróleo, Gás e Biocombustíveis",
  • "subsector": "Petróleo, Gás e Biocombustíveis",
  • "segment": "Exploração, Refino e Distribuição",
  • "interest-rate-id": "CETIP",
  • "interest-rate": 4.9,
  • "locked-days-to-maturity": -1,
  • "locked-spot-price": -1,
  • "locked-volatility": -1,
  • "ui-settings": "{\"columns\":[{\"colId\":\"_actions\",\"hide\":false,\"aggFunc\":null,\"width\":75,\"pivotIndex\":null,\"pinned\":\"left\",\"rowGroupIndex\":null},{\"colId\":\"symbol\",\"hide\":false,\"aggFunc\":null,\"width\":100,\"pivotIndex\":null,\"pinned\":\"left\",\"rowGroupIndex\":null},{\"colId\":\"moneyness\",\"hide\":false,\"aggFunc\":null,\"width\":60,\"pivotIndex\":null,\"pinned\":null,\"rowGroupIndex\":null},{\"colId\":\"strike\",\"hide\":false,\"aggFunc\":null,\"width\":70,\"pivotIndex\":null,\"pinned\":null,\"rowGroupIndex\":null},{\"colId\":\"close\",\"hide\":false,\"aggFunc\":null,\"width\":70,\"pivotIndex\":null,\"pinned\":null,\"rowGroupIndex\":null},{\"colId\":\"variation\",\"hide\":false,\"aggFunc\":null,\"width\":80,\"pivotIndex\":null,\"pinned\":null,\"rowGroupIndex\":null},{\"colId\":\"financial-volume\",\"hide\":false,\"aggFunc\":null,\"width\":90,\"pivotIndex\":null,\"pinned\":null,\"rowGroupIndex\":null},{\"colId\":\"bid\",\"hide\":false,\"aggFunc\":null,\"width\":50,\"pivotIndex\":null,\"pinned\":null,\"rowGroupIndex\":null},{\"colId\":\"ask\",\"hide\":false,\"aggFunc\":null,\"width\":50,\"pivotIndex\":null,\"pinned\":null,\"rowGroupIndex\":null},{\"colId\":\"implied-volatility\",\"hide\":false,\"aggFunc\":null,\"width\":90,\"pivotIndex\":null,\"pinned\":null,\"rowGroupIndex\":null},{\"colId\":\"bs-price\",\"hide\":false,\"aggFunc\":null,\"width\":70,\"pivotIndex\":null,\"pinned\":null,\"rowGroupIndex\":null},{\"colId\":\"delta\",\"hide\":false,\"aggFunc\":null,\"width\":70,\"pivotIndex\":null,\"pinned\":null,\"rowGroupIndex\":null},{\"colId\":\"gamma\",\"hide\":false,\"aggFunc\":null,\"width\":70,\"pivotIndex\":null,\"pinned\":null,\"rowGroupIndex\":null},{\"colId\":\"theta\",\"hide\":false,\"aggFunc\":null,\"width\":70,\"pivotIndex\":null,\"pinned\":null,\"rowGroupIndex\":null},{\"colId\":\"vega\",\"hide\":false,\"aggFunc\":null,\"width\":72,\"pivotIndex\":null,\"pinned\":null,\"rowGroupIndex\":null},{\"colId\":\"liquidity-level\",\"hide\":false,\"aggFunc\":null,\"width\":60,\"pivotIndex\":null,\"pinned\":null,\"rowGroupIndex\":null},{\"colId\":\"vi\",\"hide\":false,\"aggFunc\":null,\"width\":60,\"pivotIndex\":null,\"pinned\":null,\"rowGroupIndex\":null},{\"colId\":\"ve\",\"hide\":false,\"aggFunc\":null,\"width\":60,\"pivotIndex\":null,\"pinned\":null,\"rowGroupIndex\":null},{\"colId\":\"volume\",\"hide\":false,\"aggFunc\":null,\"width\":90,\"pivotIndex\":null,\"pinned\":null,\"rowGroupIndex\":null},{\"colId\":\"profit-rate\",\"hide\":false,\"aggFunc\":null,\"width\":70,\"pivotIndex\":null,\"pinned\":null,\"rowGroupIndex\":null},{\"colId\":\"protection-rate\",\"hide\":false,\"aggFunc\":null,\"width\":70,\"pivotIndex\":null,\"pinned\":null,\"rowGroupIndex\":null},{\"colId\":\"rho\",\"hide\":false,\"aggFunc\":null,\"width\":70,\"pivotIndex\":null,\"pinned\":null,\"rowGroupIndex\":null},{\"colId\":\"probability-of-exercise\",\"hide\":false,\"aggFunc\":null,\"width\":70,\"pivotIndex\":null,\"pinned\":null,\"rowGroupIndex\":null},{\"colId\":\"open\",\"hide\":false,\"aggFunc\":null,\"width\":50,\"pivotIndex\":null,\"pinned\":null,\"rowGroupIndex\":null},{\"colId\":\"high\",\"hide\":false,\"aggFunc\":null,\"width\":50,\"pivotIndex\":null,\"pinned\":null,\"rowGroupIndex\":null},{\"colId\":\"low\",\"hide\":false,\"aggFunc\":null,\"width\":50,\"pivotIndex\":null,\"pinned\":null,\"rowGroupIndex\":null},{\"colId\":\"time\",\"hide\":false,\"aggFunc\":null,\"width\":80,\"pivotIndex\":null,\"pinned\":null,\"rowGroupIndex\":null}]}",
  • "series": null,
  • "PETRL_20201221":
    {
    }
}

Lista taxas de juros disponivéis

Endpoint description

header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

get/v2/interest_rates
https://api.oplab.com.br/v2/interest_rates

Request samples

Copy
curl -i -X GET -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/interest_rates'

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    },
  • {
    }
]

Lista as séries de Opções em aberto na B3

Request body description

header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

get/v2/series
https://api.oplab.com.br/v2/series

Request samples

Copy
curl -i -X GET -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/series'

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Lista as séries de Opções de um determinado ativo

Request body description

path Parameters
symbol
required
string
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

get/v2/series/:symbol
https://api.oplab.com.br/v2/series/:symbol

Request samples

Copy
curl -i -X GET -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/series/:symbol'

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Lista as séries de Opções de um determinado ativo

Request body description

path Parameters
symbol
required
string
series_id
required
string
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

get/v2/options/:symbol/series_id/:series_id
https://api.oplab.com.br/v2/options/:symbol/series_id/:series_id

Request samples

Copy
curl -i -X GET -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/options/:symbol/series_id/:series_id'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "OK"
}

Lista as séries de Opções de um determinado ativo e tipo (CALL ou PUT)

Request body description

path Parameters
symbol
required
string
option_type
required
string
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

get/v2/series/:symbol/option_type/:option_type
https://api.oplab.com.br/v2/series/:symbol/option_type/:option_type

Request samples

Copy
curl -i -X GET -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/series/:symbol/option_type/:option_type'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "OK"
}

Salvar configurações visuais de uma análise

Request body description

path Parameters
id
required
number
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

post/v2/studies/:id/save_ui
https://api.oplab.com.br/v2/studies/:id/save_ui

Request samples

Copy
curl -i -X POST -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/studies/:id/save_ui'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "OK"
}

Remover série de opções em uma análise

Endpoint description

path Parameters
id
required
string
series_id
required
string
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

delete/v2/studies/:id/remove_series/:series_id
https://api.oplab.com.br/v2/studies/:id/remove_series/:series_id

Request samples

Copy
curl -i -X DELETE -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/studies/:id/remove_series/:series_id'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "OK"
}

Minhas Estratégias

Carregar lista das minhas posições fechadas

Endpoint description

header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

get/v2/positions/closed
https://api.oplab.com.br/v2/positions/closed

Request samples

Copy
curl -i -X GET -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/positions/closed'

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Carregar gráfico das minhas posições fechadas

Endpoint description

header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

get/v2/positions/evolution
https://api.oplab.com.br/v2/positions/evolution

Request samples

Copy
curl -i -X GET -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/positions/evolution'

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • 1556668799000,
  • 202500
]

Lista todos os meus grupos de posições

Endpoint description

header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

get/v2/groups
https://api.oplab.com.br/v2/groups

Request samples

Copy
curl -i -X GET -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/groups'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "313,",
  • "uid": "G313,",
  • "name": "saasassa,",
  • "spot-symbol": "",
  • "brokerage": "1.0,",
  • "interest-rate": "5.4,",
  • "notifications-enabled": "false,",
  • "notification-method": "none,",
  • "notify-above": "0,",
  • "notify-below": "0,",
  • "days-to-maturity": "4,",
  • "due-date": "2019-11-18,",
  • "created-at": "2019-11-08,",
  • "closed": "false,",
  • "realized": "0,",
  • "locked": "true,",
  • "group": "true,",
  • "horizontal": "false,",
  • "spot-price": "30.16,",
  • "spot-iv": "30.49,",
  • "spot-ewma": "29.5,",
  • "spot-variation": "0.47,",
  • "orders":
    [
    ],
  • "details":
    {
    },
  • "positions":
    [
    ]
}

Adicionar todos os meus grupos de posições

Endpoint description

header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

post/v2/groups
https://api.oplab.com.br/v2/groups

Request samples

Copy
curl -i -X POST -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/groups/'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "318,",
  • "uid": "G318,",
  • "name": "dale,",
  • "spot-symbol": "PETR4,",
  • "brokerage": "1.0,",
  • "interest-rate": "5.4,",
  • "notifications-enabled": "false,",
  • "notification-method": "none,",
  • "notify-above": "0,",
  • "notify-below": "0,",
  • "days-to-maturity": "4,",
  • "due-date": "2019-11-18,",
  • "created-at": "2019-11-11,",
  • "closed": "false,",
  • "realized": "0,",
  • "locked": "true,",
  • "group": "true,",
  • "horizontal": "false,",
  • "spot-price": "30.02,",
  • "spot-iv": "29.61,",
  • "spot-ewma": "29.5,",
  • "spot-variation": "-2.85,",
  • "orders":
    [
    ],
  • "details":
    {
    },
  • "positions":
    [
    ]
}

Carregar posições em aberto

Endpoint description

header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

get/v2/positions
https://api.oplab.com.br/v2/positions

Request samples

Copy
curl -i -X GET -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/positions/'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "days-to-maturity": "null",
  • "due-date": "null",
  • "created-at": "2019-11-09T00:00:00.000Z",
  • "closed": false,
  • "realized": 0,
  • "locked": true,
  • "group": false,
  • "horizontal": false,
  • "spot-price": 44.2,
  • "spot-iv": 40.84,
  • "spot-ewma": 41.18,
  • "spot-variation": 0.89,
  • "orders":
    [
    ],
  • "details":
    {
    }
}

Envia posições em aberto

Endpoint description

header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe
Request Body schema: application/json
spot_symbol
string
brokerage
integer
interest_rate
number
is_notifications_enabled
boolean
name
string
orders_attributes
Array of any

Responses

200

OK

post/v2/positions
https://api.oplab.com.br/v2/positions

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "position":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": 200
}

Habilitar notificações de uma posição

Endpoint description

path Parameters
id
required
number
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

post/v2/positions/:id/notifications/enable
https://api.oplab.com.br/v2/positions/:id/notifications/enable

Request samples

Copy
curl -i -X POST -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/positions/:id/notifications/enable'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": 200
}

Desabilitar notificações de uma posição

Endpoint description

path Parameters
id
required
string
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

post/v2/positions/:id/notifications/disable
https://api.oplab.com.br/v2/positions/:id/notifications/disable

Request samples

Copy
curl -i -X POST -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/positions/:id/notifications/disable'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": 200
}

Inserir uma nova ordem em uma posição

Endpoint description

path Parameters
position_id
required
string
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

post/v2/positions/:position_id/orders
https://api.oplab.com.br/v2/positions/:position_id/orders

Request samples

Copy
curl -i -X POST -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/positions/:position_id/orders'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": { }
}

Renomear posição

Endpoint description

path Parameters
id
required
string
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

patch/v2/positions/:id
https://api.oplab.com.br/v2/positions/:id

Request samples

Copy
curl -i -X PATCH -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/positions/:id'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": 200
}

Renomear posição

Endpoint description

path Parameters
id
required
string
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

put/v2/positions/:id
https://api.oplab.com.br/v2/positions/:id

Request samples

Copy
curl -i -X GET -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/positions/:id'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": 200
}

Apagar uma posição

Endpoint description

path Parameters
id
required
string
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

delete/v2/positions/:id
https://api.oplab.com.br/v2/positions/:id

Request samples

Copy
curl -i -X DELETE -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/positions/:id/'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": 200
}

Renomear posição

Endpoint description

path Parameters
id
required
string
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

put/v2/positions/:id/rename
https://api.oplab.com.br/v2/positions/:id/rename

Request samples

Copy
curl -i -X PUT -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/positions/:id/rename'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": 200
}

Fechar posição em aberto

Endpoint description

path Parameters
id
required
string
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

put/v2/positions/:id/close
https://api.oplab.com.br/v2/positions/:id/close

Request samples

Copy
curl -i -X PUT -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/positions/:id/close'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "closed": true
}

Renomeia um grupo de posições

Endpoint description

path Parameters
id
required
string
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

put/v2/groups/:id/rename
https://api.oplab.com.br/v2/groups/:id/rename

Request samples

Copy
curl -i -X PUT -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/groups/:id/rename'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": 200
}

Apaga um grupo de posições

Endpoint description

path Parameters
id
required
string
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

delete/v2/groups/:id/rename
https://api.oplab.com.br/v2/groups/:id/rename

Request samples

Copy
curl -i -X DELETE -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/portfolio/groups/:id/rename'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": 200
}

Editar dados de uma ordem em um posição

Endpoint description

path Parameters
position_id
required
number
id
required
string
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

patch/v2/positions/:position_id/orders/:id
https://api.oplab.com.br/v2/positions/:position_id/orders/:id

Request samples

Copy
curl -i -X PATCH -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/positions/:position_id/orders/:id'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": 319,
  • "uid": "G319",
  • "name": "AAAAAA",
  • "spot-symbol": "COGN3",
  • "brokerage": 1,
  • "interest-rate": 4.9,
  • "notifications-enabled": false,
  • "notification-method": "none",
  • "notify-above": 0,
  • "notify-below": 0,
  • "days-to-maturity": 4,
  • "due-date": "2019-11-18T00:00:00.000Z",
  • "created-at": "2019-11-11T00:00:00.000Z",
  • "closed": false,
  • "realized": 0,
  • "locked": true,
  • "group": true,
  • "horizontal": false,
  • "spot-price": 9.82,
  • "spot-iv": 36.05,
  • "spot-ewma": 26.9,
  • "spot-variation": -1.8,
  • "orders":
    [
    ],
  • "details":
    {
    }
}

Editar dados de uma ordem em um posição

Endpoint description

path Parameters
position_id
required
number
id
required
string
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

put/v2/positions/:position_id/orders/:id
https://api.oplab.com.br/v2/positions/:position_id/orders/:id

Request samples

Copy
curl -i -X PUT -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/positions/:position_id/orders/:id'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{ }

Apagar dados de uma ordem em um posição

Endpoint description

path Parameters
position_id
required
number
id
required
string
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

delete/v2/positions/:position_id/orders/:id
https://api.oplab.com.br/v2/positions/:position_id/orders/:id

Request samples

Copy
curl -i -X DELETE -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/positions/:position_id/orders/:id'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{ }

Altera um determinado grupo de posições

Endpoint description

path Parameters
id
required
string
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

put/v2/groups/:id
https://api.oplab.com.br/v2/groups/:id

Request samples

Copy
curl -i -X PUT -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/groups/:id'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": 319,
  • "uid": "G319",
  • "name": "AAAAAA",
  • "spot-symbol": "COGN3",
  • "brokerage": 1,
  • "interest-rate": 4.9,
  • "notifications-enabled": false,
  • "notification-method": "none",
  • "notify-above": 0,
  • "notify-below": 0,
  • "days-to-maturity": 4,
  • "due-date": "2019-11-18T00:00:00.000Z",
  • "created-at": "2019-11-11T00:00:00.000Z",
  • "closed": false,
  • "realized": 0,
  • "locked": true,
  • "group": true,
  • "horizontal": false,
  • "spot-price": 9.82,
  • "spot-iv": 36.05,
  • "spot-ewma": 26.9,
  • "spot-variation": -1.8,
  • "orders":
    [
    ],
  • "details":
    {
    },
  • "positions":
    [
    ]
}

Altera um determinado grupo de posições

Endpoint description

path Parameters
id
required
string
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

patch/v2/groups/:id
https://api.oplab.com.br/v2/groups/:id

Request samples

Copy
curl -i -X PATCH -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/groups/:id'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": 319,
  • "uid": "G319",
  • "name": "AAAAAA",
  • "spot-symbol": "COGN3",
  • "brokerage": 1,
  • "interest-rate": 4.9,
  • "notifications-enabled": false,
  • "notification-method": "none",
  • "notify-above": 0,
  • "notify-below": 0,
  • "days-to-maturity": 4,
  • "due-date": "2019-11-18T00:00:00.000Z",
  • "created-at": "2019-11-11T00:00:00.000Z",
  • "closed": false,
  • "realized": 0,
  • "locked": true,
  • "group": true,
  • "horizontal": false,
  • "spot-price": 9.82,
  • "spot-iv": 36.05,
  • "spot-ewma": 26.9,
  • "spot-variation": -1.8,
  • "orders":
    [
    ],
  • "details":
    {
    },
  • "positions":
    [
    ]
}

Deleta um determinado grupo de posições

Endpoint description

path Parameters
id
required
string
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

delete/v2/groups/:id
https://api.oplab.com.br/v2/groups/:id

Request samples

Copy
curl -i -X DELETE -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/groups/:id'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": { }
}

Portfólio

Listar ordens de proteção do meu portfólio

Endpoint description

header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

get/v2/portfolio/hedge/orders
https://api.oplab.com.br/v2/portfolio/hedge/orders

Request samples

Copy
curl -i -X GET -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/portfolio/hedge/orders'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{ }

Inserir ordens de proteção do meu portfólio

Endpoint description

header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

post/v2/portfolio/hedge/orders
https://api.oplab.com.br/v2/portfolio/hedge/orders

Request samples

Copy
curl -i -X POST -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/portfolio/hedge/orders'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{ }

Atualizar uma ordem de proteção do meu portfólio

Endpoint description

path Parameters
id
required
string
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

get/v2/portfolio/hedge/orders/:id
https://api.oplab.com.br/v2/portfolio/hedge/orders/:id

Request samples

Copy
curl -i -X GET -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/portfolio/hedge/orders/:id'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{ }

Lista os meus portfólios

Esse endpoint lista todos os portfolios existentes.

query Parameters
type
required
string
Enum: "managed" "unmanaged"

Portfolio Type. Pode ser gerenciado(managed) ou não gerenciado (unmanaged)

header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

get/v2/portfolios
https://api.oplab.com.br/v2/portfolios

Request samples

Copy
curl -i -X GET -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/portfolios?type=managed'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": 1,
  • "user_id": 10518,
  • "created_at": "2019-11-08T12:51:25.032Z",
  • "updated_at": "2019-11-08T12:51:25.032Z",
  • "alpha": null,
  • "h": null
}

Insere os meus portfólios

Endpoint description

header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe
Request Body schema: application/json

Portfolio.

portfolio
object

Responses

200

OK

post/v2/portfolios
https://api.oplab.com.br/v2/portfolios

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "portfolio":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{ }

Lista os meus portfólios

Endpoint description

header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

get/v2/portfolio
https://api.oplab.com.br/v2/portfolio

Request samples

Copy
curl -i -X GET -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/portfolio'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": { }
}

Envia os meus portfólios

Endpoint description

path Parameters
symbol
required
string
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe
Request Body schema: application/json
amount
integer
average-price
number
close
number
name
string
symbol
string
variation
number

Responses

200

OK

post/v2/portfolio/:symbol
https://api.oplab.com.br/v2/portfolio/:symbol

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "amount": 100,
  • "average-price": 35,
  • "close": 33.57,
  • "name": "BRADESCO PN",
  • "symbol": "BBDC4",
  • "variation": -1.73
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{ }

Apaga os meus portfólios

Endpoint description

path Parameters
symbol
required
string
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

delete/v2/portfolio/:symbol
https://api.oplab.com.br/v2/portfolio/:symbol

Request samples

Copy
curl -i -X DELETE -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/portfolio/:symbol'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{ }

Obtém informações de um determinado portfólio

Endpoint description

path Parameters
id
required
string
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

get/v2/portfolios/:id
https://api.oplab.com.br/v2/portfolios/:id

Request samples

Copy
curl -i -X GET -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/portfolios/:id'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": 1,
  • "user_id": 10518,
  • "=eated_at": "2019-11-08T12:51:25.032Z",
  • "updated_at": "2019-11-08T12:51:25.032Z",
  • "alpha": null,
  • "h": null
}

Atualizar um portfólio

Endpoint description

path Parameters
id
required
string
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

put/v2/portfolios/:id
https://api.oplab.com.br/v2/portfolios/:id

Request samples

Copy
curl -i -X PUT -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/portfolios/:id'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{ }

Atualizar um portfólio

Endpoint description

path Parameters
id
required
string
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

patch/v2/portfolios/:id
https://api.oplab.com.br/v2/portfolios/:id

Request samples

Copy
curl -i -X PATCH -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/portfolios/:id'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{ }

Apaga um portfólio

Endpoint description

path Parameters
id
required
string
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

delete/v2/portfolios/:id
https://api.oplab.com.br/v2/portfolios/:id

Request samples

Copy
curl -i -X DELETE -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/portfolios/:id'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{ }

Obtém as ordens de um determinado portfólio

Endpoint description

path Parameters
id
required
integer
Example: 1
header Parameters
Access-Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

get/v2/portfolios/:id/orders
https://api.oplab.com.br/v2/portfolios/:id/orders

Request samples

Copy
curl -i -X GET -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/portfolios/:id/orders'

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Cria uma ordem no portfólio

Endpoint description

path Parameters
id
required
integer
Example: 1
header Parameters
Access-Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe
Request Body schema: application/json
order
object

Responses

200

OK

post/v2/portfolios/:id/orders
https://api.oplab.com.br/v2/portfolios/:id/orders

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "order":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "order":
    {
    },
  • "position":
    {
    }
}

Executa uma ordem em um portfólio

Endpoint description

path Parameters
portfolio_id
required
string
id
required
number
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe
Request Body schema: application/json
amount
integer
price
number

Responses

200

OK

post/v2/portfolios/:portfolio_id/orders/:id/execute
https://api.oplab.com.br/v2/portfolios/:portfolio_id/orders/:id/execute

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "instrument":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    },
  • {
    },
  • {
    }
]

Adiciona instrumento no portfolio

Endpoint description

path Parameters
portfolio_id
required
string
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe
Request Body schema: application/json
symbol
string
amount
integer
price
number

Responses

200

OK

post/v2/portfolios/:portfolio_id/instruments
https://api.oplab.com.br/v2/portfolios/:portfolio_id/instruments

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "instrument":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    },
  • {
    }
]

Atualiza um instrumento de um portfolio

Endpoint description

path Parameters
id
required
number
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe
Request Body schema: application/json
amount
integer
price
number

Responses

200

OK

patch/v2/portfolios/:portfolio_id/instruments/:id
https://api.oplab.com.br/v2/portfolios/:portfolio_id/instruments/:id

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "instrument":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    },
  • {
    },
  • {
    }
]

Atualiza um instrumento de um portfolio

Endpoint description

path Parameters
id
required
number
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe
Request Body schema: application/json
amount
integer
price
number

Responses

200

OK

put/v2/portfolios/:portfolio_id/instruments/:id
https://api.oplab.com.br/v2/portfolios/:portfolio_id/instruments/:id

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "instrument":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    },
  • {
    },
  • {
    }
]

Atualiza um instrumento de um portfolio

path Parameters
id
required
number
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

delete/v2/portfolios/:portfolio_id/instruments/:id
https://api.oplab.com.br/v2/portfolios/:portfolio_id/instruments/:id

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    },
  • {
    },
  • {
    }
]

Monitor de mercado

Listar todas as ações que tem negócios em Opções

Endpoint description

header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

get/v2/stocks
https://api.oplab.com.br/v2/stocks

Request samples

Copy
curl -i -X GET -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/stocks'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": 661,
  • "symbol": "ENAT3",
  • "prefix": "ENAT",
  • "open": 13.29,
  • "high": 13.5,
  • "low": 13.2,
  • "close": 13.31,
  • "volume": 222200,
  • "variation": -0.6,
  • "financial-volume": 2968388,
  • "iv": 0,
  • "iv-1y-max": 0,
  • "iv-1y-min": 0,
  • "iv-1y-rank": 0,
  • "iv-1y-percentile": 0,
  • "iv-6m-min": null,
  • "iv-6m-max": null,
  • "iv-6m-rank": null,
  • "iv-6m-percentile": null,
  • "ewma": 0,
  • "ewma-1y-min": 0,
  • "ewma-1y-max": 0,
  • "ewma-1y-rank": 0,
  • "ewma-1y-percentile": 0,
  • "ewma-6m-min": null,
  • "ewma-6m-max": null,
  • "ewma-6m-rank": null,
  • "ewma-6m-percentile": null,
  • "short-term-trend": 1,
  • "middle-term-trend": 0,
  • "has-options": true,
  • "name": "ENAUTA PART ON"
}

Obter informações detalhadas de um determinado ativo alvo

Endpoint description

path Parameters
id
required
string
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

get/v2/stocks/:id
https://api.oplab.com.br/v2/stocks/:id

Request samples

Copy
curl -i -X GET -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/stocks/:id'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": 661,
  • "symbol": "ENAT3",
  • "prefix": "ENAT",
  • "open": 13.29,
  • "high": 13.5,
  • "low": 13.2,
  • "close": 13.31,
  • "volume": 222200,
  • "variation": -0.6,
  • "financial-volume": 2968388,
  • "iv": 0,
  • "iv-1y-max": 0,
  • "iv-1y-min": 0,
  • "iv-1y-rank": 0,
  • "iv-1y-percentile": 0,
  • "iv-6m-min": null,
  • "iv-6m-max": null,
  • "iv-6m-rank": null,
  • "iv-6m-percentile": null,
  • "ewma": 0,
  • "ewma-1y-min": 0,
  • "ewma-1y-max": 0,
  • "ewma-1y-rank": 0,
  • "ewma-1y-percentile": 0,
  • "ewma-6m-min": null,
  • "ewma-6m-max": null,
  • "ewma-6m-rank": null,
  • "ewma-6m-percentile": null,
  • "short-term-trend": 1,
  • "middle-term-trend": 0,
  • "has-options": true,
  • "name": "ENAUTA PART ON",
  • "sector": "Financeiro e Outros",
  • "subsector": "Exploração de Imóveis",
  • "segment": "Exploração de Imóveis"
}

Gráfico

Lista todas as configurações do gráfico

Endpoint description

header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

get/v2/study_templates
https://api.oplab.com.br/v2/study_templates

Request samples

Copy
curl -i -X GET -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/study_templates'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "ok",
  • "data":
    {
    }
}

Adiciona todas as configurações do gráfico

Endpoint description

header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

post/v2/study_templates
https://api.oplab.com.br/v2/study_templates

Request samples

Copy
curl -i -X POST -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/study_templates'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "ok"
}

Remove todas as configurações do gráfico

Endpoint description

header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

delete/v2/study_templates
https://api.oplab.com.br/v2/study_templates

Request samples

Copy
curl -i -X DELETE -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/study_templates'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "ok"
}

Lista todas as minha configurações de gráfico

Endpoint description

header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

get/v2/charts
https://api.oplab.com.br/v2/charts

Request samples

Copy
curl -i -X GET -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/charts'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "ok",
  • "data":
    [
    ]
}

Envia todas as minha configurações de gráfico

Endpoint description

header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

post/v2/charts
https://api.oplab.com.br/v2/charts

Request samples

Copy
curl -i -X POST -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/charts'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "ok"
}

Apaga todas as minha configurações de gráfico

Endpoint description

header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

delete/v2/charts
https://api.oplab.com.br/v2/charts

Request samples

Copy
curl -i -X DELETE -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/charts'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "ok"
}

Market data

Obtém cotações atualizadas de uma determinada lista de instrumentos

Endpoint description

header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

get/v2/data/quote
https://api.oplab.com.br/v2/data/quote

Request samples

Copy
curl -i -X GET -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/data/quote'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "symbol": "PETR4",
  • "open": 30.45,
  • "high": 30.72,
  • "low": 30.2,
  • "close": 30.41,
  • "volume": 18070900,
  • "financial_volume": 548859155,
  • "bid": 30.4,
  • "ask": 30.41,
  • "time": "2019-11-08T15:02:19.000Z"
}

Carrega as informações detalhadas de um determinado instrumento

Endpoint description

path Parameters
symbol
required
string
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

get/v2/charts/instruments/:symbol
https://api.oplab.com.br/v2/charts/instruments/:symbol

Request samples

Copy
curl -i -X GET -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/charts/instruments/:symbol'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "name": "PETR4",
  • "listed_exchange": "B3",
  • "timezone": "America/Sao_Paulo",
  • "pricescale": 100,
  • "minmov": 1,
  • "minmov2": 0,
  • "has_intraday": true,
  • "has_seconds": false,
  • "has_daily": true,
  • "has_weekly_and_monthly"": true,
  • "has_no_volume": false,
  • "volume_precision": 0,
  • "data_status": "streaming",
  • "expired": false
}

Busca instrumento por palavra chave

Endpoint description

path Parameters
expr
required
string
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

get/v2/charts/instruments/search/:expr
https://api.oplab.com.br/v2/charts/instruments/search/:expr

Request samples

Copy
curl -i -X GET -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/charts/instruments/search/:expr'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "symbol": "PETR4",
  • "fullname": "PETR4",
  • "description": "Petrobras PN",
  • "exchange": "B3",
  • "ticker": "PETR4",
  • "type": "Ação"
}

Consulta o horário do servidor

Endpoint description

header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

get/v2/charts/data/time
https://api.oplab.com.br/v2/charts/data/time

Request samples

Copy
curl -i -X GET -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/charts/data/time'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "now": "2019-11-08T10:10:29.000Z"
}

Obtém informações sobre o market data disponível

Endpoint description

header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

get/v2/charts/data/info
https://api.oplab.com.br/v2/charts/data/info

Request samples

Copy
curl -i -X GET -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/charts/data/info?from=YYYYMMDDHHmm'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "supports_search": true,
  • "supports_group_request": false,
  • "supports_marks": false,
  • "exchanges":
    [
    ],
  • "symbolsTypes":
    [
    ],
  • "supportedResolutions":
    [
    ],
  • "supports_timescale_marks": false,
  • "supports_time": true,
  • "data_source_id": "realtime",
  • "update_rate": 0
}

Carrega a série histórica de cotações de um determinado ativo e resolução

Endpoint description

path Parameters
symbol
required
string
resolution
required
string
query Parameters
from
required
string <YYYYMMDDHHmm>
to
string
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

get/v2/charts/data/:symbol/:resolution
https://api.oplab.com.br/v2/charts/data/:symbol/:resolution

Request samples

Copy
curl -i -X GET -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/charts/data/:symbol/:resolution'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "symbol": "COGN3",
  • "name": "COGN3",
  • "resolution": "1d",
  • "data":
    [
    ]
}

Lista os meus portfólios

Endpoint description

header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

get/v2/watchlist
https://api.oplab.com.br/v2/watchlist

Request samples

Copy
curl -i -X GET -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/watchlist/'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "symbol": "PETR4",
  • "price": 30.02,
  • "variation": 0,
  • "weight": 0
}

Edita os meus portfólios

Endpoint description

path Parameters
symbol
required
string
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

post/v2/watchlist/:symbol
https://api.oplab.com.br/v2/watchlist/:symbol

Request samples

Copy
curl -i -X POST -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/watchlist/:symbol'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "symbol": "PETR4",
  • "price": 30.02,
  • "variation": 0,
  • "weight": 0
}

Apaga meus portfólios

Endpoint description

path Parameters
symbol
required
string
header Parameters
Access Token
required
string
Example: P85w4/j6vYELJpQdRI9JtLhGxAYGIaDGYADgAY7FA7Y7SdUASAdsfafUASHUASHaSUHIugruhe

Responses

200

OK

delete/v2/watchlist/:symbol
https://api.oplab.com.br/v2/watchlist/:symbol

Request samples

Copy
curl -i -X DELETE -H 'Access-Token: YOUR ACCESS TOKEN' 'https://api.oplab.com.br/v2/watchlist/:symbol'