Get startedDashboard

Quickstart

Get a free key and make your first request from Python, curl or an AI assistant in under five minutes.

View llms.txt

This page takes you from nothing to a first successful request on each of the three ways to reach xfinlink: the Python client, the REST API and the MCP server. Every sample below uses a date window inside the last 12 months, so it works on every plan, including Free.

1. Choose how you connect

2. Get your API key

Create a free account at https://xfinlink.com/signup. No card is needed. The dashboard at https://xfinlink.com/dashboard creates your key; copy it with the copy button. Every sample on this page shows YOUR_API_KEY where your key goes.

A key is xfl_ followed by 32 lowercase hexadecimal characters, 36 characters in all. Keep it secret: anyone holding it can spend your plan's quota. Authentication covers the key format and where to send it.

A Free key allows 1 ticker per request, the last 12 months of history, and 100 requests a day with at most 40 in one clock hour. Plans and limits compares every plan.

3. Install the Python client

The client needs Python 3.9 or later.

Terminal
pip install -U xfinlink

Check the installed version with the command-line tool that ships with the package.

Terminal
xfinlink version
stdout
0.13.1

4. Make your first call in Python

Set your key, then ask for five days of Apple prices.

quickstart.py
import xfinlink as xfl

xfl.set_api_key("YOUR_API_KEY")

df = xfl.prices("AAPL", start="2026-09-21", end="2026-09-25")
print(df[["ticker", "date", "close", "volume", "return_daily"]])
stdout
  ticker       date   close    volume  return_daily
0   AAPL 2026-09-21  338.98  34999200      0.008479
1   AAPL 2026-09-22  339.75  40711800      0.002272
2   AAPL 2026-09-23  337.02  31658800     -0.008035
3   AAPL 2026-09-24  335.92  24733100     -0.003264
4   AAPL 2026-09-25  341.07  30002500      0.015331

close is in USD per share, volume is a count of shares, and return_daily is a decimal ratio, not a percentage: 0.015331 is a 1.5331% gain.

Instead of calling set_api_key, you can export the key before you start Python. The client reads XFINLINK_API_KEY first, then XFL_API_KEY.

Terminal
export XFINLINK_API_KEY=YOUR_API_KEY

5. Call the REST API with curl

Send the same request over HTTP. Pass the key in the X-API-Key header.

Terminal
curl -H "X-API-Key: YOUR_API_KEY" \
  "https://api.xfinlink.com/v1/prices/AAPL?start=2026-09-21&end=2026-09-25"
response.json
{
  "data": [
    {
      "entity_id": 10003635,
      "ticker": "AAPL",
      "entity_name": "APPLE INC",
      "gics_sector": "Information Technology",
      "date": "2026-09-21",
      "open": 335.28,
      "high": 339.64,
      "low": 333.05,
      "close": 338.98,
      "adj_close": 338.98,
      "volume": 34999200,
      "return_daily": 0.008478862344926119,
      "return_spans_unpriced": false,
      "exchange_code": "NASDAQ",
      "price_basis": "trade",
      "shares_outstanding": 14594180000,
      "shares_as_of": "2026-07-17",
      "shares_source": "filing",
      "shares_stale": false,
      "split_ratio": null,
      "split_ratio_suspect": false,
      "dividend": null,
      "dividend_type": null,
      ...
    },
    ...
  ],
  "meta": {
    "tickers_requested": ["AAPL"],
    "tickers_resolved": {"AAPL": 10003635},
    "tickers_unresolved": [],
    "resolved_via": {"AAPL": "security_alias"},
    "entity_id_grain": "security",
    "adj_close_basis": "split",
    "segments": [
      {"entity_id": 10003635, "entity_name": "APPLE INC", "first_date": "2026-09-21", "last_date": "2026-09-25"}
    ],
    "interval": "1d",
    "data_through": "2026-09-25",
    "count": 5,
    "limit": 1000,
    "has_more": false,
    "next_cursor": null,
    "knowledge_time": "2026-09-26T12:48:18Z",
    "as_of": "2026-09-25",
    "freshness": [
      {"dataset": "prices", "through": "2026-09-25", "promoted_at": "2026-09-21T14:19:25Z"},
      {"dataset": "price_adjustments", "through": "2026-09-25", "promoted_at": "2026-09-18T19:07:02Z"},
      {"dataset": "shares_outstanding", "through": "2026-09-23", "promoted_at": "2026-09-24T08:30:33Z"}
    ]
  }
}

Prices are in USD per share and shares_outstanding is a whole count of shares. The Python client returns the same rows as a pandas DataFrame.

6. Connect an AI assistant

The MCP server lets Claude, ChatGPT, Cursor and other MCP clients call xfinlink for you. Add this URL as a custom connector, or remote MCP server, in your client. It uses the Streamable HTTP transport.

server URL
https://api.xfinlink.com/mcp?api_key=YOUR_API_KEY

The URL contains your key, so treat it as a secret. In Claude Code, one command adds the server; run /mcp inside Claude Code afterwards to check that it is connected.

Terminal
claude mcp add --transport http --scope user xfinlink "https://api.xfinlink.com/mcp?api_key=YOUR_API_KEY"

Setup for Claude, ChatGPT, Claude Desktop, VS Code and Cursor is on MCP server. Then ask a question in plain English.

prompt
What were Apple's daily closing prices from 21 to 25 September 2026?

The assistant calls the get_prices tool. The tool result is the same JSON the REST API returns.

tool result
{"tool": "get_prices", "arguments": {"ticker": "AAPL", "start": "2026-09-21", "end": "2026-09-25"}}
{
  "data": [
    {
      "entity_id": 10003635,
      "ticker": "AAPL",
      "entity_name": "APPLE INC",
      "gics_sector": "Information Technology",
      "date": "2026-09-21",
      "open": 335.28,
      "high": 339.64,
      "low": 333.05,
      "close": 338.98,
      ...
    },
    ...
  ],
  "meta": {
    "tickers_requested": ["AAPL"],
    "tickers_resolved": {"AAPL": 10003635},
    ...
    "count": 5,
    ...
  }
}

7. Read what came back

Every response pairs the rows in data with a meta block.

  • data holds one row per trading day. entity_id 10003635 identifies Apple's common share class. Tickers and entities explains how an entity_id differs from a ticker.
  • meta.tickers_resolved shows which entity each ticker you sent was matched to.
  • meta.count is the number of rows, and meta.has_more tells you whether another page exists.
  • meta.freshness shows, for each dataset behind the response, the last date it covers.

Response metadata explains every meta field.

Next steps

  • Authentication

    Send your key in a header or a query parameter, and see which endpoints answer without one.

  • Plans and limits

    Compare what Free, Pro, Max and Redistribution allow per request and per day.

  • Response metadata

    Read meta to see how tickers were resolved and how current the data is.

  • Tickers and entities

    Use entity_id to follow one company across ticker changes and share classes.

  • Prices

    Every parameter, field and plan difference of the prices endpoint.

  • MCP server

    Set up Claude, ChatGPT, Cursor and other assistants step by step.

Was this page helpful?