PSX Market Data

Setup guide · about five minutes

How to ask the market archive a question.

From a new account to your first real answer in about five minutes, and then a tour of everything the archive can tell you about a company.

01

What you needTwo things, nothing to install.

A Google account, and one tool that can hold an API key. Cursor and ChatGPT work out of the box; anything that can call a web address works too. There is nothing to install on your own computer — the market files live on our server.

02

Set up onceThree steps, done one time.

  1. Create your account

    Open Create account and continue with Google. That is the only way in, and it is one click — no password to invent, no confirmation email to chase. Google tells us your address is real, and you land on your account page.

  2. Issue your key

    On the account page, press Issue a key. A key starts with psx_. It appears once, in a box with a copy button — copy it somewhere safe right then. The page will never show the whole key again, only its first few characters. If you lose it, press Replace key: the old key stops working at that moment and a new one is shown.

    Treat the key like a password. Anyone holding it can spend your daily and monthly calls.

  3. Give the key to your tool

    Every tool needs the same two things. The server address:

    http://127.0.0.1:8000/mcp

    And one header. The value is the word Bearer, one space, then the key — no quote marks:

    Authorization: Bearer YOUR_KEY

    This address is on this computer only. Another laptop or a phone cannot reach 127.0.0.1. The data server has to be running on the same machine, or someone has to give you a public https address and you use that instead.

03

CursorStep by step.

  1. Open Cursor Settings, then Tools and MCP.
  2. Add a custom MCP server. Choose a URL, not a local command.
  3. Paste the server address above.
  4. Add the header. Name it Authorization. Set the value to Bearer, a space, and your key.
  5. Save. The server should show as connected, and you can ask in any chat: “What did SYS last close at?”

The same setup as a file looks like this. Replace YOUR_KEY with the key you copied.

{
  "mcpServers": {
    "psx": {
      "url": "http://127.0.0.1:8000/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_KEY"
      }
    }
  }
}

If you edit the file while Cursor is open, reload the window so it connects again.

04

ChatGPTStep by step.

  1. Open Settings, then Connectors, and add a connector.
  2. Give it the server address above.
  3. When it asks you to link an account, it opens the linking page: http://127.0.0.1:8000/oauth/link. Paste the same key there.
  4. The connector asks only for the market:read scope — it can read market data with your key and nothing else.
05

Any other programScripts, sheets, Postman.

If your program has a box for a remote MCP server, use the same address and header. If it can only call a web address — a script, a spreadsheet, Postman — the saved files are also at http://127.0.0.1:8000/v1 with the same header. A history call looks like this:

curl -H "Authorization: Bearer YOUR_KEY" \
  "http://127.0.0.1:8000/v1/symbols/SYS/history?days=30"

/v1 reads the saved files only; it never fetches a live quote. The MCP address can, when you ask for one. Every path, parameter, and error is listed on the API reference.

06

Questions to try firstPlain words work.

  • “What did SYS last close at?”
  • “Is SYS up or down over the last month?”
  • “What dividends did HUBC pay this year?”
  • “What does the PE ratio mean?”
07

One company, top to bottomHub Power, symbol HUBC.

This is the part worth reading once. Everything below comes from saved files, so you will get the same numbers we do. We will use Hub Power, symbol HUBC, as the example.

The saved close

Ask “What did HUBC last close at?” and the answer is PKR 204.20 — the close of the last saved session, 13 November 2026. It is not a live price. For a live figure, say “get HUBC with a live quote”, and the answer says so.

Price history

Ask “Show HUBC for the last month” and you get one row per trading session: date, open, high, low, close, volume, and the day’s market value. A month of answers comes back at once; deeper history is paged, and your tool walks the pages for you. From it you can answer: is the price rising or falling, how jumpy is it day to day, and does anyone actually trade it. HUBC traded about 1.8 million shares on a typical recent day — busy enough that the close means something.

Dividends

Ask “What did HUBC pay?” The newest payout is a cash dividend of PKR 5.00 per share, announced 6 November 2026. Two fields here confuse everyone once. Face value is not the price: almost every PSX share has a face value of PKR 10, and a dividend is announced as a percentage of that, so 50% means PKR 5.00 on each share. The percentage and the per-share amount are the same payment said two ways. HUBC pays a large dividend every year, which is why it is an income favourite. The archive keeps every payout on record, newest first — HUBC has 39 of them.

Fundamentals, the 42 numbers

Every symbol carries 42 fundamental rows: earnings, profitability, dividends, valuation, financial health, and share structure. Each row says what it is, its unit, the period it covers, and the value. You never need the codes — ask in words and your tool finds the right row.

One reading rule covers most mistakes. Ratios are fractions: 0.20 means 20%. Multiples are already times: 14 means 14 times. The row’s unit tells you which. The only odd ones are the reported dividend yield and net margin, which arrive already in percent — 1.75 means 1.75%.

  • Is it profitable? Earnings per share is the year’s profit per share: HUBC earned PKR 38.26 a share in fiscal 2026. Return on equity says how hard the owners’ money works: 0.20 means 20 rupees of profit for every 100 rupees of equity.
  • Is it cheap? Price-to-earnings is the price divided by a year’s earnings — how many rupees you pay for one rupee of profit. Price-to-book compares the price with the accounting value of the assets. The PEG ratio checks the price against growth instead.
  • Can it pay its bills? The current and quick ratios compare what it owns soon with what it owes soon; debt-to-equity compares borrowings with the owners’ stake.
  • How much really trades? Shares outstanding is every share issued; free float is the part that can actually change hands.

The glossary for all 42 codes is at GET /v1/metrics, and the data coverage page explains how periods and scales are stored.

08

“What is HUBC’s PE?”An answer, taken apart.

Ask your tool exactly that. A good answer looks like this:

Your AI tool · connected to psx

What is HUBC’s PE?

For Hub Power (HUBC), the trailing price-to-earnings ratio is about 5.3, based on earnings per share of PKR 38.26 for fiscal year 2026 and the last saved close of PKR 204.20.

In plain terms: the market is paying about five rupees for each rupee of last year’s profit. That is low next to the wider market — common for a large power utility, and it can reflect debt, regulation, or limited growth expectations.

Figures are from the saved session of 13 November 2026, not a live quote.

Notice what a good answer does:

  • It shows the number and the arithmetic: 204.20 ÷ 38.26 ≈ 5.3.
  • It says what the number means in plain words.
  • It says where the figures came from and which session they belong to.

One warning that applies everywhere: a low PE is not automatically a bargain. It can mean the company is cheap, or that the market expects its profits to fall. The number tells you what the price is, not what it should be.

09

Beyond one companyIndices, news, the whole market.

  • Indices. Ten are saved, including KSE100. “Show the last month of KSE100” works exactly like a stock’s history.
  • News and announcements are fetched when you ask, not saved, so they are as fresh as the source.
  • Market overview. “What is the market doing?” returns the fear-and-greed reading, gainers, losers, sectors, forex, and gold rates.
10

How an answer is labelledAnd how far a key goes.

Every answer says where its figures came from:

  • archiveRead from a saved file. Everything in the company tour above works this way, and the saved sessions currently run through 13 November 2026.
  • liveFetched at the moment you asked, because that figure is not stored.
  • mixedPart saved, part fetched. If a fetch fails, the saved part still comes back and the answer is marked partial.

A free key can ask 5 times a minute, 100 times a day, and 1,000 times a month. Pro costs PKR 2,000 a month and allows 10 a minute, 300 a day, and 3,000 a month. The minute resets as it turns, the day at midnight UTC, and the month on the 1st. If you run out early, credits pay for extra calls, one credit per call, and never expire. Your live counts are the meters on the account page.

Nothing here is a broker, a prediction, or a recommendation. Read the disclaimer.

11

When something stopsWhat you see, what to do.

What you seeWhat to do
Google says the provider is not enabled.Google is the only way in. If it says that, the switch on our side is off — try again shortly.
401 or unauthorized.The header is missing, the key was revoked or replaced, or the word Bearer is not followed by one space. Check the key prefix on the account page.
429 or rate limit.You passed 5 calls in a minute, 100 in a day, or 1,000 in a month. The minute resets as it turns, the day at midnight UTC, and the month on the 1st. The account page shows which one you hit.
The address does not connect.Check that the data server is running. A 127.0.0.1 address only works on that same computer.
The answer says partial.The saved figures are still there. One live figure was unavailable.
You lost the key.Replace it on the account page, then update the program with the new key.

Ask your first question in the next five minutes.

Free to start. Upgrade only when you need more calls.