Skip to main content

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 
        impact = event.impact
        category = event.category 
        date = event.date 
        actual = event.actual
        forecast = event.forecast 
        previous = event.previous 
        outcome = event.outcome 
        strength = event.strength 
        quality = event.quality 
        trend = event.trend 

        # print the calendar info
        print(f"Event Name: {name}\nEvent ID: {event_id}\nCurrency: {currency}\nImpact: {impact}\nDate: {date}\nActual: {actual}\nForecast: {forecast}\nPrevious: {previous}\nTrend: {trend}")

You can also access our NewsGPT model:

gpt_response = jb.gpt(api_key,"What does bullish mean in forex?")
print(gpt_response)

Metadata

Release files for jb-news 2.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for jb-news 2.4.0
File Interpreter ABI Platform
jb_news-2.4.0-py3-none-any.whl Python 3 none any Details

Release files / jb_news-2.4.0-py3-none-any.whl

Download URL jb_news-2.4.0-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8933f2048cafc09f8c27a9935a156d56e84bc8f58534e3149e242fdf95623f1b
BLAKE2b-256 checksum
How to use checksums
60719021d3f08618bcfa9d4e5148feaf599c645cff561f558cbd186da0eac156
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.4

Release history Release notifications | RSS feed

This release

2.4.0 This release

1 release file

2.3.4

1 release file

2.3.3

1 release file

2.3.2

1 release file

2.3.1

1 release file

2.3.0

1 release file

2.2.6

1 release file

2.2.5

1 release file

2.2.4

1 release file

2.2.3

1 release file

2.2.2

1 release file

2.2.1

1 release file

2.2.0

1 release file

2.1.1

1 release file

2.1.0

1 release file

2.0.3

1 release file

2.0.2

1 release file

2.0.1

1 release file

2.0.0

1 release file

1.3.1

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page