A comprehensive wrapper for JBlanked's News API, leveraging OpenAI, Machine Learning, and MQL5's Calendar.
Project description
JB-News
This library is a comprehensive wrapper for JBlanked's News API. It leverages the power of OpenAI, Machine Learning, and MQL5's Calendar to provide developers with easy access to news data across all computer languages, including MQL4 and Python. Full documentation: https://www.jblanked.com/news/api/docs/
Features
- Easy access to JBlanked's News API
- Access to News Event History, Machine Learning Predictions, Smart Analysis, and more.
- Access to News Calendar
- Supports multiple programming languages including MQL4 and Python
Python Installation
pip install jb-news
This API is freely accessible through our library and through GET requests. Get your API key from: https://www.jblanked.com/profile/. Note that the free tier has a rate limit of once every 5 minutes, but VIP members enjoy unrestricted access.
Python Usage
After installation, import the class:
from jb_news.news import JBNews
Then set a variable as an instance of the JBNews class:
jb = JBNews()
A list of Event IDs are found on https://www.jblanked.com/news/api/docs/.
Next, set your API key and Event ID:
API_KEY = "YOUR_API_KEY_HERE"
NEWS_SOURCE = NEWS_SOURCE_MQL5 # or NEWS_SOURCE_FOREX_FACTORY, NEWS_SOURCE_FXSTREET
EVENT_ID = 756020001 # CHF CPI
jb.offset = 7 # GMT-3 = 0, GMT = 3, EST = 7, PST = 10
Next step is to connect to the API by using the get method.
if jb.get(API_KEY, news_source=NEWS_SOURCE):
Lastly, load the event info of the specified Event ID:
if jb.load(EVENT_ID):
name = jb.info.name
currency = jb.info.currency
event_id = jb.info.event_id
history = jb.info.history
category = jb.info.category
machine_learning = jb.info.machine_learning
smart_analysis = jb.info.smart_analysis
# print the news info
print(f"Event Name: {name}\nEvent ID: {event_id}\nCurrency: {currency}")
Alternatively, instead of using the get method, you can load the calendar:
if jb.calendar(API_KEY,today=True,news_source=NEWS_SOURCE):
for event in jb.calendar_info:
name = event.name
currency = event.currency
event_id = event.event_id
category = event.category
date = event.date
actual = event.actual
forecast = event.forecast
previous = event.previous
outcome = event.outcome
strength = event.strength
quality = event.quality
projection = event.projection
# print the calendar info
print(f"Event Name: {name}\nEvent ID: {event_id}\nCurrency: {currency}\nDate: {date}\nActual: {actual}\nForecast: {forecast}\nPrevious: {previous}")
You can also access our NewsGPT model:
gpt_response = jb.gpt(api_key,"What does bullish mean in forex?")
print(gpt_response)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jb_news-2.3.1-py3-none-any.whl.
File metadata
- Download URL: jb_news-2.3.1-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4845b7d1b877c621a0c9b618579d315dda10219c7ba836b5755b0f917c26ccbd
|
|
| MD5 |
6cabc0ca6fb6df4f5ab6f899ad3db0ea
|
|
| BLAKE2b-256 |
91e33641823bf01fd07cfc609cf568681f4e90db9c7b63fab6bba74aaa56d643
|