GnistAI GnistAI
Log in

Getting Started with Space Weather

Space weather — solar flares, geomagnetic storms, ISS position tracking.

All Tutorials   |   Overview   |   Playground   |   MCP   |   REST API   |   Home
Science

Data source: NASA DONKI, Open Notify

Overview

Space Weather wraps NASA DONKI, Open Notify, handling authentication, pagination, and rate limits for you. This tutorial covers all 4 tools with working code examples you can copy and run.

Prerequisites

  1. Sign up at https://context.gnist.ai/signup for a free API key (100 calls/day).
  2. Choose your integration method: MCP protocol or REST API.

Connect via MCP

Add to your MCP client config (Claude Desktop, Cursor, etc.):

MCP Config
{
  "mcpServers": {
    "gnist-space-weather": {
      "url": "https://context.gnist.ai/mcp/space-weather/",
      "headers": {
        "Gnist-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Tools (4)

get_solar_flares

Get recent solar flare events from NASA. Returns flare class (A/B/C/M/X), timing, source location, and active region. Args: days: Number of days to look back (1-30, default 7).

ParameterTypeRequiredDescription
daysintegeroptional (default: 7)
curl -X POST "https://context.gnist.ai/mcp/space-weather/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_solar_flares", "arguments": {"days": 7}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/space-weather/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'days': 7}, 'name': 'get_solar_flares'}},
)
print(resp.json())

get_geomagnetic_storms

Get recent geomagnetic storm events from NASA. Returns storm timing and maximum Kp index (planetary K-index, 0-9 scale). Kp >= 5 indicates a geomagnetic storm; Kp >= 7 is severe. Args: days: Number of days to look back (1-60, default 30).

ParameterTypeRequiredDescription
daysintegeroptional (default: 30)
curl -X POST "https://context.gnist.ai/mcp/space-weather/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_geomagnetic_storms", "arguments": {"days": 30}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/space-weather/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'days': 30}, 'name': 'get_geomagnetic_storms'}},
)
print(resp.json())

get_iss_position

Get the current position of the International Space Station. Returns latitude, longitude, and timestamp.

curl -X POST "https://context.gnist.ai/mcp/space-weather/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_iss_position", "arguments": {}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/space-weather/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {}, 'name': 'get_iss_position'}},
)
print(resp.json())

report_feedback

Report a bug, feature request, or general feedback for this data source. Use this when something doesn't work as expected, when you'd like a new feature, or when you have suggestions for improvement. Args: feedback: Describe the issue or suggestion. feedback_type: One of 'bug', 'feature_request', or 'general'.

ParameterTypeRequiredDescription
feedbackstringrequired
feedback_typestringoptional (default: general)
curl -X POST "https://context.gnist.ai/mcp/space-weather/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "report_feedback", "arguments": {"feedback": "example"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/space-weather/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'feedback': 'example'}, 'name': 'report_feedback'}},
)
print(resp.json())

FAQ

What data does Space Weather provide?

Space weather — solar flares, geomagnetic storms, ISS position tracking. It exposes 4 tools: get_solar_flares, get_geomagnetic_storms, get_iss_position, report_feedback.

What do I need to get started?

A Gnist API key (free tier: 100 calls/day). Sign up at https://context.gnist.ai/signup.

What format does the Space Weather API return?

JSON, via either MCP protocol (JSON-RPC 2.0) or REST API.

Next Steps

Related Tutorials