Skip to main content

Official Python SDK for the G-Prophet AI Stock Prediction API

Project description

G-Prophet Python SDK

Official Python client for the G-Prophet AI Stock Prediction API.

Installation

pip install gprophet

To also use the MCP Server (for AI agents like Claude, Kiro, etc.):

pip install gprophet[mcp]

Quick Start

from gprophet import GProphet

client = GProphet(api_key="gp_sk_your_key_here")

# Check balance
print(client.balance())

# Get a stock quote
quote = client.quote("AAPL", market="US")
print(f"AAPL: ${quote['price']}")

# AI prediction
pred = client.predict("AAPL", market="US", days=7)
print(f"Predicted: ${pred['predicted_price']} ({pred['direction']})")

# Technical analysis
tech = client.technical("AAPL", market="US")
print(f"Signal: {tech['overall_signal']}")

# Batch quotes
quotes = client.batch_quote(["AAPL", "GOOGL", "MSFT"], market="US")
for q in quotes["results"]:
    if q["success"]:
        print(f"{q['symbol']}: ${q['price']}")

# AI stock analysis (async with auto-polling)
analysis = client.analyze_stock("AAPL", market="US", wait=True)
print(analysis["analysis"]["summary"])

MCP Server (for AI Agents)

After installing with pip install gprophet[mcp], a gprophet-mcp command is available.

See MCP Server documentation for setup details.

API Reference

System

  • client.health() — Health check
  • client.info() — API metadata, pricing, supported markets

Account

  • client.balance() — Points balance and quota info
  • client.usage(days=7) — Usage statistics

Predictions

  • client.predict(symbol, market, days, algorithm) — AI price prediction
  • client.compare(symbol, market, days, algorithms) — Multi-algorithm comparison

Market Data

  • client.quote(symbol, market) — Real-time quote
  • client.batch_quote(symbols, market) — Batch quotes
  • client.history(symbol, market, period) — Historical OHLCV
  • client.search(keyword, market, limit) — Search symbols

Technical Analysis

  • client.technical(symbol, market, indicators) — Technical indicators & signals

Sentiment

  • client.fear_greed(days) — Crypto Fear & Greed Index
  • client.market_overview(market) — Market overview

Analysis

  • client.analyze_stock(symbol, market, locale, wait) — AI stock analysis (58 pts)
  • client.analyze_comprehensive(symbol, market, locale, wait) — Multi-agent analysis (150 pts)
  • client.task_status(task_id) — Check async task status

Error Handling

from gprophet import GProphet
from gprophet.client import GProphetError, RateLimitError, InsufficientPointsError

client = GProphet(api_key="gp_sk_...")

try:
    result = client.predict("AAPL", market="US")
except RateLimitError as e:
    print(f"Rate limited, retry after {e.retry_after}s")
except InsufficientPointsError as e:
    print(f"Need {e.required} points, have {e.available}")
except GProphetError as e:
    print(f"API error [{e.code}]: {e.message}")

Configuration

client = GProphet(
    api_key="gp_sk_...",
    base_url="https://gprophet.com/api/external/v1",  # Custom base URL
    timeout=60,       # Request timeout (seconds)
    max_retries=3,    # Auto-retry on rate limit
)

License

MIT

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

gprophet-0.1.1.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

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

gprophet-0.1.1-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file gprophet-0.1.1.tar.gz.

File metadata

  • Download URL: gprophet-0.1.1.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for gprophet-0.1.1.tar.gz
Algorithm Hash digest
SHA256 33a338d2fda00727d6a8d455fa5daaf7d86960ac6df89de8d4e2ca1354f0b9e5
MD5 89927a638c034774a725b7fe0293b40c
BLAKE2b-256 8de6d4ba7547dcfb3b0abae9494b53bdf23bfe0f97cd6cb44ac9734f32c17ec8

See more details on using hashes here.

File details

Details for the file gprophet-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: gprophet-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for gprophet-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b79cfdc1ae419a55f9cb17806f0e2533c87e814c8aa96020cacb2a37fa046dcf
MD5 08f30e375858fc708fe1c8fb02161928
BLAKE2b-256 1a11ff7f261a0c8188a506db791f3da53a5adaaef5a0b1d3ffb4f432d48c2284

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 Pingdom Monitoring Sentry Error logging StatusPage Status page