## Refinitiv
### Historical Data
Documentaion: [Refinitiv Data Library for Python Documentation](https://cdn.refinitiv.com/public/rd-lib-python-doc/1.0.0.0/book/en/index.html)
#### Python API: get_history()
##### Parameters
- **universe**: Single instrument or list of instruments to request.
- **fields**: Single field or list of fields to request.
- **interval**: Data sampling interval.
- supported values: tick, tas, taq, minute, 1min, 5min, 10min, 30min, 60min, hourly, 1h, daily, 1d, 1D, 7D, 7d, weekly, 1W, monthly, 1M, quarterly, 3M, 6M, yearly, 1Y
- **start**: The start date and timestamp of the requested history.
- **end**: The end date and timestamp of the requested history.
- **adjustment**
- **count**: The maximum number of data points returned.
##### Returned value
A pandas.DataFrame with fields in columns and instruments as row index.
##### Examples
1. The following example demonstrates the last 5 ticks of historical pricing data:
```
import refinitiv.data as rd
# open session
rd.open_session()
df = rd.get_history(
universe="GOOG.O",
fields=["BID", "ASK"],
interval="tick",
count=5
)
print(df)
# close session
rd.close_session()
```
Output:
```
GOOG.O BID ASK
Timestamp
2022-08-11 22:30:22.567 119.90 120.16
2022-08-11 22:31:02.653 119.90 120.16
2022-08-11 22:31:11.701 119.88 120.16
2022-08-11 22:31:11.749 119.90 120.16
2022-08-11 22:31:22.840 119.90 120.16
```
2. The following example demonstrate the OHLC bar given the data and resampling time.
```
df=rd.get_history(universe="GOOG.O", fields=['BID','ASK'], interval="tick", count=2000)
df.ohlc("5s")
```
Output:
```
GOOG.O BID ASK
open high low close open high low close
Timestamp
2022-04-05 08:12:05+00:00 2869.57 2869.57 2869.57 2869.57 2882.2 2882.2 2881.4 2881.40
2022-04-05 08:12:10+00:00 2868.90 2870.07 2868.90 2870.07 2881.4 2882.2 2881.4 2881.40
2022-04-05 08:12:15+00:00 NaN NaN NaN NaN NaN NaN NaN NaN
2022-04-05 08:12:20+00:00 2868.90 2870.97 2868.90 2869.07 2881.4 2881.4 2881.4 2881.40
2022-04-05 08:12:25+00:00 2869.07 2870.07 2868.90 2870.07 2881.4 2881.4 2881.4 2881.40
... ... ... ... ... ... ... ... ...
2022-04-05 09:25:00+00:00 2870.01 2870.01 2870.01 2870.01 2880.0 2888.0 2880.0 2886.92
2022-04-05 09:25:05+00:00 2870.01 2870.01 2870.01 2870.01 2888.0 2888.0 2880.5 2885.00
2022-04-05 09:25:10+00:00 NaN NaN NaN NaN NaN NaN NaN NaN
2022-04-05 09:25:15+00:00 NaN NaN NaN NaN NaN NaN NaN NaN
2022-04-05 09:25:20+00:00 2870.01 2870.01 2870.01 2870.01 2880.0 2883.0 2880.0 2883.00
```
More examples can be found [Access Layer Examples](https://github.com/LSEG-API-Samples/Example.DataLibrary.Python/blob/main/Examples/1-Access/EX-1.01.02-GetHistory.ipynb) and [Content Layer Examples](https://github.com/LSEG-API-Samples/Example.DataLibrary.Python/blob/main/Examples/2-Content/2.01-HistoricalPricing/EX-2.01.01-HistoricalPricing.ipynb)
## Bloomberg
### Historical Data
Bloomberg's data is based on [examples in Core Develper Guide](https://data.bloomberglp.com/professional/sites/10/2017/03/BLPAPI-Core-Developer-Guide.pdf).
[Bloomberg Python API](https://github.com/msitt/blpapi-python/tree/master)
#### Reference Data Service
The reference data service provides the ability to access the following Bloomberg data with the Request/Response
paradigm:
- **Reference Data (ReferenceDataRequests)**: Provides the current value of a security/field pair.
- **Historical End-of-Day Data (HistoricalDataRequest)**: Provides end-of-day data over a defined period of time for a security/field pair.
- **Historical Intraday Tick Data (IntradayTickRequests)**: Provides each tick over a defined period of time for a single security and one or more Event types.
- **Historical Intraday Bar Data (IntradayBarRequests)**: Provides a series of intraday summaries over a defined period of time for a single security and Event type.
-
## Factset
## Comparison
<table>
<thead>
<tr>
<th></th>
<th>Bloomberg Terminal</th>
<th>Bloomberg B-PIPE</th>
<th>Bloomberg Data License</th>
<th>Refinitiv</th>
<th>FactSet</th>
</tr>
</thead>
<tbody>
<tr>
<td>Pricing</td>
<td>$30000/year</td>
<td>>$8500/month</td>
<td>以欄位計價</td>
<td>$22,000/year</td>
<td>$12,000/year</td>
</tr>
<tr>
<td>Content</td>
<td></td>
<td>real-time streaming data, ...</td>
<td>historical data, snapshot, reference data, foundamental data, ...</td>
<td>historical data (Request/Response), real-time streaming data (Subscription), ...</td>
<td></td>
</tr>
<tr>
<td>Language</td>
<td></td>
<td>C++, Python, ...</td>
<td>C++, Python, ...</td>
<td>C++ (Refinitiv Real-Time C++ SDK), Python (Refinitiv Data Library for Python), ...</td>
<td></td>
</tr>
</tbody>
</table>
## Questions
### Bloomberg
1. [Market Data](https://www.bloomberg.com/professional/product/market-data/)及[Reference Data](https://www.bloomberg.com/professional/product/reference-data/)等,是否有越南,印尼,以及馬來西亞的歷史及即時資料?不同國家資料是否有normalized?
2. 是否有提供下單的服務?
3. 是否有rate limit?
4. ~~是否有行情表或Contract Info? (以日期及國家為單位,e.g.可一次query/request取得2023/11/07越南的各商品資料)~~
5. Reference Data (historical pricing data, dividends, or maturity dates, etc.)是否可以以日期及國家為單位去做request,e.g.可一次query/request取得2023/11/07越南的各商品的相關資料
6. license是否一定包含terminal,若不需要terminal(只需要data的部分),價格是否有便宜?一個license是否限定同時只有一個user可以使用?
7.
## Reference
- [Pricing Comparison](https://www.wallstreetprep.com/knowledge/bloomberg-vs-capital-iq-vs-factset-vs-thomson-reuters-eikon/)