Documentation

Getting Started

Welcome to the **Gold Rate API** documentation! This guide will help you quickly integrate our API into your applications to access real-time and historical precious metals data.

Note: If you don't have an API key yet, you can get one for free on our pricing page.

All API requests are made over HTTPS to ensure secure data transmission.

Authentication

Include your unique API access key with every request as a query parameter named x-api-key.

GET https://app.goldapi.net/price/XAU?x-api-key=YOUR_API_KEY

Important: Keep your API key secure and do not expose it in client-side code.

Real-time Data Endpoint

Get current spot prices for gold, silver, platinum, and palladium.

Endpoint URL

GET https://app.goldapi.net/price/METAL_CODE/CURRENCY_CODE?x-api-key=YOUR_API_KEY

Parameters

  • METAL_CODE (required): XAU, XAG, XPT, XPD.
  • CURRENCY_CODE (required): 3-letter currency code (e.g., USD, EUR).

Example Request

GET https://app.goldapi.net/price/XAU/USD?x-api-key=YOUR_API_KEY

Example Response

{
                    "metal": "XAU",
                    "currency": "USD",
                    "price": 2350.75,
                    "ch": 15.20,
                    "chp": 0.65,
                    "ask": 2351.00,
                    "bid": 2350.50,
                    "timestamp": 1678886400
                }

Historical Data Endpoint

Access historical spot prices for any supported metal on a specific date.

GET https://api.goldapi.net/v1/historical/XAU/USD/2024-01-10?x-api-key=...

Rate Limits

  • Free: 100 requests/month.
  • Pro & Ultimate: Unlimited API requests.

Exceeding limits results in 429 Too Many Requests.

Subscription & Billing

Paid plans are billed through Stripe. You can manage payment methods, view invoices, and update your subscription from the Stripe customer portal.

Sign in to your account, then open Billing Portal from the account menu.

Manage your plan

  • View current plan and next billing date
  • Download invoices and receipts
  • Update your payment method
  • Switch plans from the Plans & Pricing page

How to Unsubscribe

Cancellations are handled in Stripe, not inside the GoldAPI dashboard directly. Follow these steps:

  1. Sign in to your GoldAPI account.
  2. Open Billing Portal from the top menu or your Account page.
  3. You will be redirected to Stripe’s secure billing page.
  4. Select your active subscription and click Cancel plan or Cancel subscription.
  5. Confirm the cancellation when prompted.
Important: After you cancel, you usually keep access until the end of the current billing period. Stripe will send a confirmation email when the cancellation is processed.

If you cannot access the billing portal, contact [email protected].

Error Handling

  • 400: Bad Request
  • 401: Unauthorized (Invalid Key)
  • 404: Not Found
  • 429: Rate Limit Exceeded
  • 500: Internal Server Error