100 free credits. No credit card required. Get a key

How to scrape stock price history with cURL

Open, high, low, close, adjusted close and volume between two dates, daily to quarterly, with dividends and splits.

The examples use curl with jq to pick fields out of the JSON, which is the quickest way to see the data and to script it in a shell.

GET /v1/finance/history1 credit per callRefunded on failure

Before you start

  1. Get an API keySign up for 100 free credits, no card. Keys start with gs_live_.
  2. Put it in the environmentEvery example reads it from GROUNDSOCIAL_API_KEY: export GROUNDSOCIAL_API_KEY=gs_live_…
  3. Set up cURLjq --version # brew install jq, or apt install jq

Call Stock price history API from cURL

GET /v1/finance/history. Save this as fetch.sh and run bash fetch.sh.

fetch.sh
# The whole response, pretty-printed:
curl -sS "https://api.groundsocial.dev/v1/finance/history?keyword=AAPL&start_date=2025-01-01&end_date=2025-06-30" \
  -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" | jq .

# Just the fields, one line per item:
curl -sS "https://api.groundsocial.dev/v1/finance/history?keyword=AAPL&start_date=2025-01-01&end_date=2025-06-30" \
  -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" \
  | jq -r '.'

The response

A real Finance response to this call, recorded from the live API on 27 Nov 2026 and shortened for display: arrays keep their first items and … marks every cut. The recorded page had 122 items in rows. Live calls return current data in the same shape.

200 OK
{
  "symbol": "AAPL",
  "interval": "1d",
  "chart": {
    "meta": {
      "symbol": "AAPL",
      "currency": "USD",
      "exchangeName": "NMS",
      "fullExchangeName": "NasdaqGS",
      "instrumentType": "EQUITY",
      "firstTradeDate": 345479400,
      "regularMarketTime": 1795640402,
      "hasPrePostMarketData": true,
      "gmtoffset": -18000,
      "timezone": "EST",
      "exchangeTimezoneName": "America/New_York",
      "regularMarketPrice": 355.58,
      "regularMarketChangePercent": 0.426,
      "fulldayPrice": 355.58,
      "fulldayChange": 1.03,
      "fulldayChangePercent": 0.291,
      "fiftyTwoWeekHigh": 360.83,
      "fiftyTwoWeekLow": 243.42,
      "regularMarketDayHigh": 356.75,
      "regularMarketDayLow": 345.13,
      "regularMarketVolume": 53060252,
      "longName": "Apple Inc.",
      "shortName": "Apple Inc.",
      "chartPreviousClose": 250.42,
      "…": "5 more fields"
    },
    "timestamp": [
      1735828200,
      1735914600,
      "… 120 more"
    ],
    "indicators": {
      "quote": [
        {
          "open": [
            248.92999267578125,
            243.36000061035156,
            "… 120 more"
          ],
          "volume": [
            55740700,
            40244100,
            "… 120 more"
          ],
          "low": [
            241.82000732421875,
            241.88999938964844,
            "… 120 more"
          ],
          "high": [
            249.1000061035156,
            244.17999267578125,
            "… 120 more"
          ],
          "close": [
            243.8500061035156,
            243.36000061035156,
            "… 120 more"
          ]
        }
      ],
      "adjclose": [
        {
          "adjclose": [
            241.90933227539065,
            241.42323303222656,
            "… 120 more"
          ]
        }
      ]
    },
    "events": {
      "dividends": {
        "1739197800": {
          "amount": 0.25,
          "date": 1739197800
        },
        "1747056600": {
          "amount": 0.26,
          "date": 1747056600
        }
      }
    }
  },
  "rows": [
    {
      "date": "2025-01-02T14:30:00.000Z",
      "open": 248.92999267578125,
      "high": 249.1000061035156,
      "low": 241.82000732421875,
      "close": 243.8500061035156,
      "adjclose": 241.90933227539065,
      "volume": 55740700
    },
    {
      "date": "2025-01-03T14:30:00.000Z",
      "open": 243.36000061035156,
      "high": 244.17999267578125,
      "low": 241.88999938964844,
      "close": 243.36000061035156,
      "adjclose": 241.42323303222656,
      "volume": 40244100
    },
    "… 120 more"
  ]
}

Top-level fields

FieldTypeDescription
symbolstring–
intervalstring–
chartFinanceChart–
rowsobject[]–

Parameters

NameInTypeDescription
keyword (required)querystringA ticker (AAPL, ^GSPC, EURUSD=X, BTC-USD) or a company name. Example: AAPL.
start_date (required)querystringYYYY-MM-DD.
end_date (required)querystringYYYY-MM-DD.
intervalquery"1d" | "5d" | "1wk" | "1mo" | "3mo"One of 1d, 5d, 1wk, 1mo, 3mo.

Errors and retries

Every error is JSON with error.code (stable: branch on it), message, hint (what to do next), docs_url and retryable. A failed call is never charged. Retry only when retryable is true, after the Retry-After header.

Errors
# --fail-with-body exits non-zero on a 4xx/5xx and still saves the error JSON.
curl -sS "https://api.groundsocial.dev/v1/finance/history?keyword=AAPL&start_date=2025-01-01&end_date=2025-06-30" \
  -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY" \
  --fail-with-body -o page.json \
  || jq -r '.error | "\(.code): \(.hint)"' page.json
StatusMeaning
200Price rows, oldest first, and the raw chart.
400Invalid input. Nothing was charged.
401Missing or invalid API key.
402Not enough credits, a spend cap was reached, or payment is required.
403The target is private, or the account is suspended.
404No ticker or data matches.
429Too many requests. Wait for Retry-After seconds.
503Finance is temporarily unavailable. Retryable; nothing was charged.

Every error code and what to do about it.

Pricing

Cost
Per call1 credit per call
1,000 calls$1.00 on the starter pack, $0.40 at volume
No key (MPP or x402)$0.01 per call
Failed callRefunded, never charged

Every response has x-credits-charged and x-credits-remaining headers. Credits never expire. Packs and calculator.

From an AI agent (MCP)

The same call is the finance_history_get tool on the hosted MCP server, so Claude, Cursor or any MCP client can make it without code. Add the server once:

bash
claude mcp add --transport http groundsocial https://api.groundsocial.dev/mcp

Then ask for it in words (“Price history between two dates, daily to quarterly”), or call the tool directly:

json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "finance_history_get",
    "arguments": {
      "keyword": "AAPL",
      "start_date": "2025-01-01",
      "end_date": "2025-06-30"
    }
  }
}

MCP setup for Claude Desktop, Cursor, VS Code and ChatGPT.

Backtest a strategy

Pull daily rows for the window you test.

Questions

Which intervals?

1d, 5d, 1wk, 1mo and 3mo.

Keep going

Run it on your own data

One key for Finance and 76 more platforms, over REST or MCP. Free credits on signup, no card.

Finance is a trademark of Yahoo Inc. We are not affiliated with or endorsed by Yahoo Inc.