GPT API

AI-powered sentiment analysis on forex news events and statements.

Overview

Access the GPT endpoint by sending a POST request to:

POST https://www.jblanked.com/news/api/gpt/

Include a "content" key in your request body with your query as the value.

Pricing: 5 credits per POST request. GET requests are free. Purchase credits and monitor usage.

How It Works

  1. Send a POST request with your query. You'll receive a JSON response containing a task_id and a message confirming the task has started.
  2. Retrieve the response by sending a GET request to:
    GET https://www.jblanked.com/news/api/gpt/status/YOUR-TASK-ID

Example Request & Response

{
  "content": "In less than 8 words, what does bullish mean?"
}
{
  "status": "complete",
  "message": "Expecting rising prices or market growth."
}

Code Examples

import requests

url = "https://www.jblanked.com/news/api/gpt/"
headers = {
    "Content-Type": "application/json",
    "Authorization": "Api-Key YOUR_API_KEY"
}
data = {"content": "In less than 8 words, what does bullish mean?"}
response = requests.post(url, headers=headers, json=data)

if response.status_code == 200:
    task_id = response.json()["task_id"]
    print(f"Task ID: {task_id}")
    # Poll for the result
    status_url = f"https://www.jblanked.com/news/api/gpt/status/{task_id}"
    result = requests.get(status_url, headers=headers)
    print(result.json())
import Foundation

let baseURL = "https://www.jblanked.com/news/api/gpt/mobile/"
var components = URLComponents(string: baseURL)!
components.queryItems = [
    URLQueryItem(name: "message", value: "What does bullish mean?")
]

var request = URLRequest(url: components.url!)
request.addValue("Api-Key YOUR_API_KEY", forHTTPHeaderField: "Authorization")
request.addValue("application/json", forHTTPHeaderField: "Content-Type")

let (data, _) = try await URLSession.shared.data(for: request)
let response = try JSONDecoder().decode(GPTResponse.self, from: data)
print(response.task_id)

struct GPTResponse: Decodable {
    var task_id: String
    var message: String
}
#include <jb-requests.mqh>

int OnInit() {
    CRequests request;
    request.url = "https://www.jblanked.com/news/gpt/";
    request.key = "YOUR_API_KEY";
    request.loader["content"] = "What does bullish mean?";

    if(!request.POST()) {
        Print("Failed to send GPT request");
        return INIT_FAILED;
    }

    Print(request.result);
    string taskID = request.loader["task_id"].ToStr();
    return(INIT_SUCCEEDED);
}

Library Usage

from jb_news.news import CJBNews

jb = CJBNews()
api_key = "YOUR_API_KEY_HERE"
gpt_response = jb.GPT(api_key, "What does bullish mean in forex?")
print(gpt_response)
import JBNews

let yourAPIKey = "YOUR-API-KEY"
let newsModel = JBNews(yourAPIKey)

Task {
    let response: String = await newsModel.gpt(
        message: "In less than 8 words, what does bullish mean?"
    )
    print(response)
}

Ready to integrate AI-powered sentiment analysis?

Get instant access to GPT-powered forex insights and predictions.

Get API Credits Go Unlimited
Support