BDL ETF Ideas API

Table of contents

How to query 

You can use the following query to get the latest content matching your API subscription: 

curl -H 'Authorization: Bearer YOUR_API_KEY' https://ideasequities.timgroup.com/api/v1/stream/{stream_id}/{event_number}/{batch_size} 

Where: 

{stream_id} is the identifier for a given steam. 

{event_number} is the last event number processed (-1 is the start). 

{batch_size} is the maximum number of events to return, capped at 1000. 

The server will return as many events as specified in the The server will return as many events as specified in the {batch_size} or as many as are available, whichever is smaller. When no events are returned the end of the stream has been reached. 

When no new events are available the server will hold the connection open until new events are available, for up to five minutes. This means events will be pushed to the client as soon as they become available in the system. The header ‘X-Long-Poll’ can be used to configure how long the server should hold the connection open awaiting new events. 

Given a stream with five events, numbered 0 to 4, the following would return immediately with event 4: 

curl -H 'Authorization: Bearer YOUR_API_KEY' -H 'X-Long-Poll: 10' https://ideasequities.timgroup.com/api/v1/stream/{stream_id}/3/5 

Given the same stream of five events, the below would return after 10 seconds or when the event with number 5 is published: 

curl -H 'Authorization: Bearer YOUR_API_KEY' -H 'X-Long-Poll: 10' https://ideasequities.timgroup.com/api/v1/stream/{stream_id}/4/5 

If the intent is to subscribe to the live stream, a new request should be made whenever the previous has completed. When there are no new events the same request is repeated. Otherwise the event number is updated to that of the last processed event. 

To get the latest event number the following will give you the most recent ten events: 

curl -H 'Authorization: Bearer YOUR_API_KEY' https://ideasequities.timgroup.com/api/v1/stream/{stream_id}/ 

Response 

Ideas are represented as an ordered sequence of events (e.g. opened, closed) with a correlation identifier. To construct the current state of an Idea all of its events must be processed in the provided order. If there is a problem with an event, the system will stop publishing new events to protect data integrity until Acuris has resolved the underlying issue. 

The following is an example of an ‘IdeaOpened’ event: 

{  

 "event_number": 123,  

 "event_type": "IdeaOpened",  

 "data": {  

"id": "348a382fb66dd2111a416331e0187b196e69002d",  

"timestamp": "2018-06-04T14:34:43.393Z",  

"published_at": "2018-06-04T14:34:43.393Z",  

"origin": "User",  

"idea": {  

"state": "open",  

"open_timestamp": "2018-06-04T14:34:43.393Z", 

"close_timestamp": null,  

"author": {  

"id": "01f9b626470829f92ca4103d852dfc8680fb6389", 

"company": {  

"id": "0b048bd1949a96fc5e1c475ee7d21dec1b41244e" 

 }  

},  

"recommendations": [  

 { "public_id": "bd9e0fde421b619aa1bb07caa32c2c05b9bb0ae7",  

"instrument": {  

"public_id": "2fbbff04ddb2c97c576cd72a0a8bd5da", 

"ric": "EQNR.OL",  

"bloomberg_ticker": "EQNR NO",  

"exchange_code": "OSL" 

 },  

"direction": "SHORT" 

 } 

 ] 

 }  

}  

} 

The following is an example of an ‘IdeaClosed’ event: 

 "event_number": 125,  

 "event_type": "IdeaClosed",  

 "data": {  

"id": "348a382fb66dd2111a416331e0187b196e69002d",  

"timestamp": "2018-06-04T14:34:43.393Z",  

"published_at": "2018-06-04T14:34:43.393Z",  

"origin": "User",  

"idea": {  

"state": "closed",  

"open_timestamp": "2018-06-04T14:34:43.393Z", 

"close_timestamp": "2018-06-04T14:35:11.225Z ",  

"author": {  

"id": "01f9b626470829f92ca4103d852dfc8680fb6389", 

"company": {  

"id": "0b048bd1949a96fc5e1c475ee7d21dec1b41244e" 

 }  

},  

"recommendations": [  

 { "public_id": "bd9e0fde421b619aa1bb07caa32c2c05b9bb0ae7",  

"instrument": {  

"public_id": "2fbbff04ddb2c97c576cd72a0a8bd5da", 

"ric": "EQNR.OL",  

"bloomberg_ticker": "EQNR NO",  

"exchange_code": "OSL" 

 },  

"direction": "SHORT" 

 } 

 ] 

 }  

}  

}