Python SDK for the UniBit API
Project description
UniBit
A Python module to get stock data and news from the UniBit API
UniBit is a free API that provides real time and historical financial data, as well as financial news. This SDK is a client-side implementation of the UniBit API (https://www.unibit.ai) which has Python functions for each available API call. For the UniBit API documentation, visit (https://unibit.ai/docs)
To get started, sign up at (https://unibit.ai/login) to request a free access key. With a free key, all non-news API features are available with generous rate limits.
The UniBit Stock News API requires a premium account, but in return gives a wealth of news articles on all 8000 US-listed companies. Along with this, UniBit provides analyses on each news article. With deep learning, each article is classified into a comprehensive genre list, and named entities and sentiment are also extracted.
Install
To install UniBit, type:
pip install python-unibit
To install from the source, type:
git clone https://github.com/unibit-api/python-unibit.git
pip install -e python-unibit
Examples
Get the real time price of Apple (AAPL)
from unibit.stockprice import StockPrice
sp = StockPrice(key="YOUR_KEY")
aapl_price = sp.getPricesRealTime("AAPL")
Get Apple's Company Profile
from unibit.companyinfo import CompanyInfo
ci = CompanyInfo(key="YOUR_KEY")
aapl_profile = ci.getCompanyProfile("AAPL")
Get the latest news on Apple
from unibit.news import StockNews
sn = StockNews(key="YOUR_KEY")
aapl_news = sn.getLatestStockNews("AAPL")
The CSV format is supported on many of the UniBit APIs. Requesting a CSV datatype will return a csv.reader()
of the data
from unibit.stockprice import StockPrice
sp = StockPrice(key="YOUR_KEY")
aapl_price_csv = sp.getPricesRealTime("AAPL", size=10, datatype="csv")
Contribute!
In the UniBit Python SDK, we not only want to wrap the UniBit API, but open source methods of stock analysis, be it with some fancy quantitative strategy, with graphing, or with machine learning. Propose something in an issue or contact me at stefan@unibit.ai if you want to help!
Documentation
Detailed documentation on the UniBit API is available at https://unibit.ai/docs.
License
This project is developed under an MIT License.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for python_unibit-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05fee582f92caab98a6f3b8bded79924138a661a2edd956ab7ff259d8502437a |
|
MD5 | 73bf3cfbe41f13b8963751e30bfcfd64 |
|
BLAKE2b-256 | 778cfcf16c7b612d1238c289c2dfc9dc5191b39e74c00407205f78f9932bb173 |