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.

Features

  • Easy access to JBlanked's News API
  • Access to News Event History, Machine Learning Predictions, Smart Analysis, and more.
  • Supports multiple programming languages including MQL4 and 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.

Usage

After installation, import the class:

from jb_news.news import CJBNews 

Then set a variable as an instance of the CJBNews class:

jb = CJBNews()

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" 
event_id = 756020001 # CHF CPI

Next step is to connect to the API by using the get method.

if jb.get(api_key):  

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.eventID 
        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):
    for event in jb.calendar_info:
        name = event.name
        currency = event.currency 
        event_id = event.eventID 
        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}\Forecast: {forecast}\Previous: {previous}")

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jb_news-2.0.2-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file jb_news-2.0.2-py3-none-any.whl.

File metadata

  • Download URL: jb_news-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for jb_news-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 729db171ce671a91b91eec112bdf0932dded611ef9759b89310edba6b0a21e21
MD5 77616e13f7b8a8be927b7386bcb7100a
BLAKE2b-256 2fb21edfea93b27467d4cb349c0b3966c74336e2aa013e2c20fe07a18015ed6a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page