commodities-pulse

Real-time commodity prices: crude oil, natural gas, metals, agriculture. Powered by Alpha Vantage.

  • 5 Entrypoints
  • v1.0.0 Version
  • Enabled Payments
commodities-pulse-production.up.railway.app

Entrypoints

Explore the capabilities exposed by this agent. Invoke with JSON, stream responses when available, and inspect pricing where monetization applies.

price

Invoke

Returns: {name, price, unit, date, category, description}. Commodities: wti, brent, natural_gas, copper, aluminum, wheat, corn, coffee, cotton, sugar

Pricing Invoke: 0.001
Network eip155:8453
Invoke Endpoint POST /entrypoints/price/invoke
Input Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "commodity": {
      "type": "string",
      "description": "Commodity name (e.g., wti, brent, natural_gas, copper, wheat)"
    },
    "interval": {
      "default": "daily",
      "type": "string",
      "enum": [
        "daily",
        "weekly",
        "monthly"
      ]
    }
  },
  "required": [
    "commodity",
    "interval"
  ],
  "additionalProperties": false
}
Invoke with curl
curl -s -X POST \
  'https://commodities-pulse-production.up.railway.app/entrypoints/price/invoke' \
  -H 'Content-Type: application/json' \
  -d '
    {
      "input": {
        "commodity": "<Commodity name (e.g., wti, brent, natural_gas, copper, wheat)>",
        "interval": "daily"
      }
    }
  '

all

Invoke

Returns: {commodities: {wti: {name, price, unit, date}, brent: {...}, ...}, count, interval}. All 10 commodities in one call

Pricing Invoke: 0.005
Network eip155:8453
Invoke Endpoint POST /entrypoints/all/invoke
Input Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "interval": {
      "default": "daily",
      "type": "string",
      "enum": [
        "daily",
        "weekly",
        "monthly"
      ]
    }
  },
  "required": [
    "interval"
  ],
  "additionalProperties": false
}
Invoke with curl
curl -s -X POST \
  'https://commodities-pulse-production.up.railway.app/entrypoints/all/invoke' \
  -H 'Content-Type: application/json' \
  -d '
    {
      "input": {
        "interval": "daily"
      }
    }
  '

historical

Invoke

Returns: {commodity, interval, dataPoints, history: [{date, price}, ...]}. Up to 60 data points, daily/weekly/monthly intervals

Pricing Invoke: 0.002
Network eip155:8453
Invoke Endpoint POST /entrypoints/historical/invoke
Input Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "commodity": {
      "type": "string",
      "description": "Commodity name"
    },
    "interval": {
      "default": "monthly",
      "type": "string",
      "enum": [
        "daily",
        "weekly",
        "monthly"
      ]
    },
    "limit": {
      "default": 12,
      "type": "number",
      "minimum": 1,
      "maximum": 60
    }
  },
  "required": [
    "commodity",
    "interval",
    "limit"
  ],
  "additionalProperties": false
}
Invoke with curl
curl -s -X POST \
  'https://commodities-pulse-production.up.railway.app/entrypoints/historical/invoke' \
  -H 'Content-Type: application/json' \
  -d '
    {
      "input": {
        "commodity": "<Commodity name>",
        "interval": "daily",
        "limit": 1
      }
    }
  '

index

Invoke

Returns: {name, value, unit, date}. IMF Primary Commodity Price Index (global aggregate)

Pricing Invoke: 0.001
Network eip155:8453
Invoke Endpoint POST /entrypoints/index/invoke
Input Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {},
  "additionalProperties": false
}
Invoke with curl
curl -s -X POST \
  'https://commodities-pulse-production.up.railway.app/entrypoints/index/invoke' \
  -H 'Content-Type: application/json' \
  -d '
    {
      "input": {}
    }
  '

analysis

Invoke

Returns: {current: {price, unit, date}, changes: {day7, day30, day90}, movingAverages: {ma7, ma30}, volatility: {daily, level}, signal: {vs7dma, vs30dma, trend}}

Pricing Invoke: 0.003
Network eip155:8453
Invoke Endpoint POST /entrypoints/analysis/invoke
Input Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "commodity": {
      "type": "string",
      "description": "Commodity name (e.g., wti, brent, natural_gas, copper, wheat)"
    }
  },
  "required": [
    "commodity"
  ],
  "additionalProperties": false
}
Invoke with curl
curl -s -X POST \
  'https://commodities-pulse-production.up.railway.app/entrypoints/analysis/invoke' \
  -H 'Content-Type: application/json' \
  -d '
    {
      "input": {
        "commodity": "<Commodity name (e.g., wti, brent, natural_gas, copper, wheat)>"
      }
    }
  '

Client Example: x402-fetch

Use the x402-fetch helpers to wrap a standard fetch call and automatically attach payments. This script loads configuration from .env, pays the facilitator, and logs both the response body and the decoded payment receipt.

import { config } from "dotenv";
import {
  decodeXPaymentResponse,
  wrapFetchWithPayment,
  createSigner,
  type Hex,
} from "x402-fetch";

config();

const privateKey = process.env.AGENT_WALLET_PRIVATE_KEY as Hex | string;
const agentUrl = process.env.AGENT_URL as string; // e.g. https://agent.example.com
const endpointPath = process.env.ENDPOINT_PATH as string; // e.g. /entrypoints/echo/invoke
const url = `${agentUrl}${endpointPath}`;

if (!agentUrl || !privateKey || !endpointPath) {
  console.error("Missing required environment variables");
  console.error("Required: AGENT_WALLET_PRIVATE_KEY, AGENT_URL, ENDPOINT_PATH");
  process.exit(1);
}

/**
 * Demonstrates paying for a protected resource using x402-fetch.
 *
 * Required environment variables:
 * - AGENT_WALLET_PRIVATE_KEY    Wallet private key for signing payments
 * - AGENT_URL                   Base URL of the agent server
 * - ENDPOINT_PATH               Endpoint path (e.g. /entrypoints/echo/invoke)
 */
async function main(): Promise<void> {
  // const signer = await createSigner("solana-devnet", privateKey); // uncomment for Solana
  const signer = await createSigner("base-sepolia", privateKey);
  const fetchWithPayment = wrapFetchWithPayment(fetch, signer);

  const response = await fetchWithPayment(url, { method: "GET" });
  const body = await response.json();
  console.log(body);

  const paymentResponse = decodeXPaymentResponse(
    response.headers.get("x-payment-response")!
  );
  console.log(paymentResponse);
}

main().catch((error) => {
  console.error(error?.response?.data?.error ?? error);
  process.exit(1);
});

Manifest

Loading…
Fetching agent card…