- 主页
- HTTP API集成
HTTP API集成
快速设置HTTP连接,并开始流传输实时报价和构建金融应用程序
工具信息请求
示例
curl -u application_id:application_access_key
'https://api-demo.exante.eu/md/3.0/symbols/AAPL.NASDAQ'
响应
{
"optionData": null,
"i18n": {},
"name": "Apple",
"symbolId": "AAPL.NASDAQ",
"description": "Apple Inc. - Common Stock",
"country": "US",
"exchange": "NASDAQ",
"symbolType": "STOCK",
"minPriceIncrement": '0.01',
"ticker": "AAPL",
"expiration": null,
"group": null
}
市场数据请求
示例
curl -u application_id:application_access_key —header
'Accept: application/x-json-stream'
'https://api-demo.exante.eu/md/3.0/feed/AAPL.NASDAQ'
响应
{
"timestamp": 1598267680756,
"symbolId": "AAPL.NASDAQ",
"bid": {
"price": '512.25',
"size": '100.0'
},
"ask": {
"price": '512.38',
"size": '100.0'
}
}
历史数据请求
示例
curl -u application_id:application_access_key
'https://api-demo.exante.eu/md/3.0/ohlc/AAPL.NASDAQ/600?from=151597949342000&to=1597952942000&size=2'
响应
[
{
"timestamp":1598269800000,
"open":'512.995',
"low":'512.745',
"close":'513.21',
"high":'513.3'
},
{
"timestamp":1598269200000,
"open":'512.095',
"low":'511.695',
"close":'512.945',
"high":'512.975'
}
]
下单请求
示例
curl -X POST -u application_id:application_access_key
-H 'Content-Type: application/json'
-d '{"symbolId": "AAPL.NASDAQ", "orderType": "market", "side": "buy", "quantity": "6","duration": "day", "accountId": "RAT9106.001"}'
'https://api-demo.exante.eu/trade/3.0/orders'
响应
[{
"placeTime":"2020-08-24T14:29:34.931Z",
"username":"example@example.com",
"orderId":"ef605b8b-4d27-4aba-b2b3-deb6fefe9835",
"orderState": {
"status":"placing",
"lastUpdate":"2020-08-24T14:29:34.931Z",
"fills":[]
},
"accountId":"RAT9106.001",
"orderParameters": {
"side":"buy",
"duration":"day",
"quantity":'6',
"symbolId":"AAPL.NASDAQ",
"ocoGroup":null,
"ifDoneParentId":null,
"orderType":"market"
},
"currentModificationId":"ef605b8b-4d27-4aba-b2b3-deb6fefe9835"
}]
帐户汇总请求
示例
curl -u application_id:application_access_key
'https://api-demo.exante.eu/md/3.0/summary/RAT9106.001/2020-08-24/EUR'
响应
{
"currencies": [
{
"code":"EUR",
"convertedValue":'100000.0',
"price":'100000.0'
},
{
"code":"USD",
"convertedValue":'-3909.18',
"price":'-4621.8'
}
],
"timestamp":1598279283000,
"freeMoney":'99087.48',
"netAssetValue":'99925.3',
"accountId":"RAT9106.001",
"moneyUsedForMargin":'837.82',
"marginUtilization":'0.01',
"positions": [
{
"convertedPnl":'-74.55',
"quantity":'9',
"pnl":'-88.14',
"symbolId":"AAPL.NASDAQ",
"convertedValue":'3834.47',
"price":'503.72',
"symbolType":"STOCK",
"currency":"USD",
"averagePrice":'513.5133',
"value":'4533.48'
},
{
"convertedPnl":'0.0',
"quantity":'0',
"pnl":'0.0',
"symbolId":"ULVR.LSE",
"convertedValue":'0.0',
"price":'45.83',
"symbolType":"STOCK",
"currency":"GBP",
"averagePrice":null,
"value":'0.0'
}
],
"sessionDate":[2020,8,24],
"currency":"EUR"
}