FundsAPI
Skip to documentation
API v1Pakistan mutual fund data

Build with Pakistan’s fund data

From your first API key to a reliable integration. Find funds, read NAV and payouts, and work with validated monthly reports.

Download Markdown
BASE URLhttps://funds.api.ilovepsx.com
01

Your first request

#

Start with the registry. It gives you the fund slugs to use in every later request.

  1. Sign in using your existing ILovePSX account and explicitly enable fund API access. Activation requires your verified primary email, WhatsApp number, intended use and terms acknowledgement.
  2. Open Dashboard → API keys. Create a key with funds:read, then add nav:read or fmr:read for the data you need. Save the secret when it is shown once.
  3. Set ILOVEPSX_API_KEY in your server's environment or secret manager. The examples read it at runtime. Never commit the value or expose it through NEXT_PUBLIC_* variables.
  4. Run the registry request below. A 200 response contains success, data and meta. Choose a data[].slug, then use that exact slug in NAV, report or payout requests.

The cURL examples use Bash/POSIX syntax. For PowerShell, Python and JavaScript, use the language selector. Python needs httpx; JavaScript examples run on a modern Node.js server.

PowerShell · first request
$headers = @{ "X-API-Key" = $env:ILOVEPSX_API_KEY }
$response = Invoke-RestMethod -Headers $headers -Uri "https://funds.api.ilovepsx.com/v1/mutual-funds/funds?per_page=10"
$response.data | Select-Object name, slug

Run it on your server

curl --fail-with-body --request GET \
  --header "X-API-Key: $ILOVEPSX_API_KEY" \
  "https://funds.api.ilovepsx.com/v1/mutual-funds/funds?per_page=10"

Choose a slug from the response before replacing YOUR_FUND_SLUG in later examples. The examples contain no real key.

Create your API key ↗
02

Choose the right endpoint

#

Use the registry for identity, NAV for dated prices, and Fund Manager Reports for reported monthly facts.

The API serves canonical registry/NAV records and active promoted FMR facts. Raw extraction, staging and review controls are private. Derived analytics remain conditional and are excluded from this public reference until verified. Stock data, a hosted MCP server and an official client SDK are not provided here.

03

Authentication and scopes

#

Financial-data requests use your API key in the X-API-Key header. The /v1/availability endpoints expose anonymous counts, dates and coverage indicators. Reading these docs needs no account.

ScopeWhat it allows
funds:readRegistry, fund profiles, AMCs and classification vocabularies
nav:readLatest/historical NAV, NAV batches and observed payouts
fmr:readReports, snapshots, reported performance and portfolio sections
catalog:readAPI catalog, fields, enums and production coverage metadata
updates:readIncremental production update events

The reference shows the required scope for each endpoint; the key must also belong to an active account. Login sessions manage your account in the portal; use an API key for integrations. Visiting account status does not activate the service or create a key.

Use separate keys for separate integrations. Rotation immediately revokes the previous secret, so update your server secret when rotating. A revoked secret cannot be recovered. Keep keys out of URLs, client bundles, browser storage, logs, screenshots and AI prompts. Use the authenticated explorer to try data requests without pasting a key into these docs.

04

Read a response

#

Successful JSON has a common envelope. Dataset fields inside data depend on the endpoint.

Synthetic NAV response · fictional fund and values
{
  "success": true,
  "data": [
    {
      "fund_id": "00000000-0000-4000-8000-000000000201",
      "fund_slug": "example-research-fund",
      "fund_name": "Example Research Fund",
      "mufap_fund_id": null,
      "nav_date": "2026-09-30",
      "nav": "100.500000",
      "offer_price": "100.500000",
      "repurchase_price": "100.500000",
      "market_price": null,
      "front_end_load_pct": "0.000000",
      "back_end_load_pct": "0.000000",
      "contingent_load_pct": null,
      "nav_change_abs": null,
      "nav_change_pct": null,
      "currency": "PKR"
    }
  ],
  "meta": {
    "request_id": "00000000000040008000000000000402",
    "generated_at": "2026-10-08T08:00:00Z",
    "data_as_of": "2026-09-30",
    "data_freshness_days": 8
  }
}
FieldMeaning
successtrue for a successful JSON response
dataAn array or object specific to the endpoint; empty arrays are valid
meta.request_idCorrelation ID to retain for debugging and support
meta.generated_atUTC time when the response was constructed; not the source observation date
meta.data_as_ofAvailable source date; inspect row dates too when comparing multiple funds
meta.data_freshness_daysSource age when supplied; null means unavailable, not fresh
meta.next_cursorOpaque next-page token, or null when this feed is exhausted
meta.missing_fundsRequested slugs missing from a bulk result when this field is present

The OpenAPI contract describes authentication, parameters, request bodies and the shared envelope. Many dataset data fields are not fully typed in that schema. Do not generate assumptions from the generic data property; use these labelled examples, the detailed guides and the authenticated explorer to inspect actual results.

05

Decimals, dates and missing values

#

Preserve the source meaning through storage, calculations and display.

ConventionIntegration rule
Financial decimalsJSON strings preserve precision. Use Decimal or a decimal library for calculations.
PercentagesPercentage points: 5.25 represents 5.25%, not a 0.0525 stored fraction.
DatesYYYY-MM-DD. NAV dates and FMR report dates are different concepts.
TimestampsUTC ISO-8601. Keep source dates separate from generated_at.
CurrencyNAV prices and payout amounts are PKR; retain currency fields when supplied.
null / absentUnavailable or inapplicable facts; never silently replace them with zero.
IdentityUse public UUIDs and registry slugs. Do not invent a slug from a display name.
LatestLatest available production observation, which may be older than today.
Python · calculate using exact decimals
from decimal import Decimal

# Illustrative values, not investment advice or observed fund prices.
nav = Decimal("100.500000")
units = Decimal("12.5")
value_pkr = nav * units
assert value_pkr == Decimal("1256.2500000")
print(value_pkr)

Do not treat raw NAV change as an investor's total return: distributions, fees, unit adjustments and the chosen observation dates can affect interpretation. Monthly reported returns must retain their report period and original labels.

06

Fund Manager Reports and coverage

#

A valid fund can have no promoted report for a requested month. A valid report can have missing sections.

  • Check /v1/availability/funds/{slug}?year=2026 first: available_months and unavailable_months describe the selected year, and months includes each period's status and exact report_date. This anonymous metadata operation uses no account units; report data still requires fmr:read.
  • List /funds/{fund_slug}/fmr-reports to discover available reporting dates. Use a date returned by that list when requesting a historical report.
  • For a complete report, add include=all, or request the supported expansions explicitly. A default report can omit sections that were not requested.
  • Keep report_date, data_version, report fragments and supplied provenance together. NAV source dates and FMR periods should not be combined into one freshness label.
  • An omitted expansion, NOT_REPORTED section and unavailable report are different states. A section's empty rows do not justify inventing holdings or allocation weights.
  • Credit quality is available through its focused endpoint and reported allocations. Do not invent a credit_quality expansion. Portfolio coverage and denominators differ by section.

Extraction goes through validation, staging and matching/review before production promotion. This process does not guarantee complete AMC coverage or that every source fact was reported. For corrections, retain public report versions and process update events idempotently.

Month statusSafe interpretation
AVAILABLEActive promoted FMR data is available. Request the returned report_date exactly, with include=all when needed; sections can still be empty.
UNAVAILABLEA closed month has no active report in this API. It may be unpublished, uncollected, unpromoted or withdrawn; the metadata does not claim an internal job state or overdue delivery.
PRE_INCEPTIONNo API report and the month is before the known fund launch month. Unknown launch dates do not establish this boundary.
CURRENT_PERIOD / FUTURE_PERIODNo available report for an unfinished or future UTC calendar period. These are not included in unavailable_months.
Python · discover months before requesting a report
import os
import httpx

# Obtain slug from the registry, not from a guessed display name.
slug = os.environ["FUND_SLUG"]
base = "https://funds.api.ilovepsx.com"
with httpx.Client(base_url=base, timeout=20) as client:
    response = client.get(f"/v1/availability/funds/{slug}", params={"year": 2026})
    response.raise_for_status()
    coverage = response.json()["data"]
    available = [m for m in coverage["months"] if m["available"]]
    print("Unavailable closed months:", coverage["unavailable_months"])
    if available:
        report_date = available[-1]["report_date"]
        report = client.get(
            f"/v1/mutual-funds/funds/{slug}/fmr-reports/{report_date}",
            params={"include": "all"},
            headers={"X-API-Key": os.environ["ILOVEPSX_API_KEY"]},
        )
        # A report can be withdrawn after metadata was checked. Never replace
        # 404 with another month or invented zeros; refresh coverage instead.
        report.raise_for_status()

year and report_month must agree when supplied together. report_month implies its year when year is omitted. Without selectors, the latest observed report year is returned, or the current UTC year when there are no reports. Selecting an empty year/month never substitutes the latest report. as_of_date classifies the calendar; meta.generated_at is retrieval time; report_date is the source period. Cache revalidation follows production promotions, corrections and withdrawals. Use Dashboard → Explorer → FMR to inspect the same calendar.

Complete-report includeSections
Defaultsub_funds, reported_returns, metrics, fees, ratings, parties, source
Additional expansionsallocations, holdings, special_terms, compliance, notes
allEvery supported complete-report expansion. This does not guarantee populated rows.
Exampleinclude=holdings,allocations or repeated include=holdings&include=allocations
07

Pagination and synchronization

#

Follow the pagination style published for the endpoint. Keep the filters stable between pages.

StyleHow to continue
page / per_pageStart at page=1. Use returned meta.has_next / total_pages and effective per_page.
cursor / limitPass meta.next_cursor unchanged. Stop when it is null; keep fund, range and order unchanged.
Repeated array parametersUse funds=SLUG_A&funds=SLUG_B or category=VALUE_A&category=VALUE_B, not a comma-joined list unless explicitly supported.
Bulk bodiesPOST a JSON funds array. Inspect missing_funds rather than assuming every requested fund appears.
Python · collect registry pages
import os
import httpx

with httpx.Client(
    base_url="https://funds.api.ilovepsx.com",
    headers={"X-API-Key": os.environ["ILOVEPSX_API_KEY"]},
    timeout=30, follow_redirects=False,
) as client:
    page = 1
    while True:
        response = client.get("/v1/mutual-funds/funds",
                              params={"page": page, "per_page": 100})
        response.raise_for_status()
        payload = response.json()
        for fund in payload["data"]:
            print(fund["slug"])
        if not payload["meta"]["has_next"]:
            break
        page += 1

For cursor feeds, replace only cursor in the original query and URL-encode it with your HTTP client. Do not decode, alter or use a cursor for a different filter. Save synchronization checkpoints only after you have processed a page successfully.

08

Request bounds and batch reads

#

Ask for only the data you need. Operational bounds remain active under the free offer.

OperationPublished default / bound
Registry listsper_page defaults to 50; the default service maximum is 100 and returned meta shows the effective size.
NAV historylimit defaults to 500; schema maximum 1000. Default maximum date span is 3653 days.
Payout historylimit defaults to 100, maximum 500. Default range is 1827 days; maximum span is 1830 days.
FMR report listspage defaults to 1; per_page defaults to 50, maximum 100.
Bulk fund selectionDefault service maximum 100 fund slugs; required non-empty funds array.
Bulk NAV datedate omitted reads latest; date supplied uses the requested date_policy. Bulk from/to fields are not a NAV history interface.

Schema bounds and deployed service settings are distinct: a request can fit the OpenAPI type but exceed a service bound. Handle a 422 response and inspect the authenticated catalog rather than increasing payloads indefinitely. Do not assume every endpoint supports all filters.

09

Free usage and rate limits

#

The current offer has free unlimited monthly usage, with burst protection per key.

There is no monthly usage bill or payment-card requirement. The current burst limit is 600 weighted units per minute per key, with a separate explorer-session bucket. Units represent endpoint workload. Future pricing will be announced separately.

ReadWeighted units
Standard registry, NAV history, payouts and focused FMR reads1
Complete FMR and latest complete snapshot2
GET NAV bulk / POST fund bulk2
POST NAV bulk / VPS family snapshot3
POST snapshot bulk5
Response headerAction
RateLimit-LimitWeighted burst capacity
RateLimit-RemainingRemaining weighted capacity in this bucket
RateLimit-ResetBucket reset information; do not assume it is a source-data timestamp
Retry-AfterWait the indicated duration after a 429 before retrying
X-Monthly-Quota-Limitunlimited under the current free offer
X-Request-IDRetain this ID for failures and support

Rejected authorization and limit checks do not consume units; server-error reservations are refunded. Successful reads and conditional requests still follow access and burst policy. Activity history can lag enforcement by a few seconds. Avoid synchronized parallel retry storms.

10

Caching and resilient requests

#

Use bounded requests, explicit timeouts and a retry policy that understands the response.

  • Where an ETag is supplied, store it with the response and send If-None-Match on the next read. A 304 has no JSON body: reuse your cached data.
  • Cache by the complete URL, filters and customer context. Keep authenticated responses in your own private application cache; never expose customer credentials through a shared cache.
  • ETags represent a complete response, including changing generation metadata. A subsequent request can return 200 even when the underlying facts look unchanged; do not depend on 304 for correctness.
  • For 429, honor Retry-After. For transient 500/503 or network failures, use bounded exponential backoff with jitter and a maximum attempt count. Keep failed batches/checkpoints recoverable.
  • Do not retry invalid keys, missing scopes, unavailable funds or invalid input indefinitely. Surface the problem code and request ID. Read-only bulk POSTs query data; they do not write production facts.
  • Disable credential-bearing redirects and validate JSON/error responses before using them. Avoid logging headers or full response bodies that could contain customer secrets.
11

Troubleshoot with a request ID

#

Errors use application/problem+json. Inspect the HTTP status and stable code before deciding what to do.

Synthetic validation error
{
  "type": "https://api.ilovepsx.com/problems/validation-error",
  "title": "Request validation failed",
  "status": 422,
  "detail": "One or more request values are invalid.",
  "instance": "/v1/mutual-funds/funds",
  "request_id": "example-request-id",
  "code": "VALIDATION_ERROR",
  "errors": [
    {
      "location": "query.page",
      "message": "Input should be greater than or equal to 1",
      "type": "greater_than_equal"
    }
  ]
}
StatusLikely causeNext step
400 / 422Invalid filters, bounds, date or expansionInspect code and errors; correct the request before retrying.
401Missing, invalid, inactive or expired API keyCheck the server environment and key status; rotate if needed.
403Missing scope or unavailable accountCheck required scope, activation and account status.
404Unknown fund or unavailable production reportUse the registry and report catalog; represent absence explicitly.
429Weighted burst capacity exceededWait Retry-After, reduce concurrency and retry within a bound.
500 / 503Service or dependency failureRetry with backoff; retain request ID and UTC timestamp.
12

Use these docs with AI

#

Give a coding assistant the public contract and integration rules without sharing your credentials.

Copy the AI prompt, or download the guide/reference as Markdown and attach them to your assistant. Assistants with URL-reading tools can begin at /llms.txt. If yours cannot fetch URLs, attach /llms-full.txt or the OpenAPI JSON instead.

AI integration prompt
Use the ILovePSX Funds API to implement my integration. First read https://funds.api.ilovepsx.com/llms.txt and https://funds.api.ilovepsx.com/docs/index.md, then the relevant operations in https://funds.api.ilovepsx.com/docs/reference.md or import https://funds.api.ilovepsx.com/docs/openapi. Ask me which language and dataset I need. Use only published endpoints. Read ILOVEPSX_API_KEY from a server environment variable; never ask me to paste a secret into chat. Discover fund slugs from the registry. Preserve exact decimal strings, nulls, source dates, FMR reporting periods and provenance. Handle pagination, missing reports, 304, 429 Retry-After and bounded retries. Do not invent coverage, analytics endpoints, SDKs or an MCP server. Clearly label synthetic examples and cite the documentation used. Produce runnable server-side code and explain setup and error handling.

These resources are documentation. They do not grant account access, run API requests or install a connector. Any live request still needs an active account and an appropriately scoped server-side key. AI-produced code should preserve missing values and source dates and be checked against the published contract.

13

Support and next steps

#

Include enough context to investigate your integration without exposing a secret.

  • Send the request ID, method and endpoint, UTC timestamp, status/problem code and a short description. Include your public account ID when relevant.
  • Redact full API keys, bearer tokens and customer details from logs or screenshots.
  • Use the dashboard for keys, usage and request history; use the explorer for authenticated data inspection. Deeper guides are in the public blog library.

Email zia639329@gmail.com or WhatsApp (+923194583904).

NEXT STEP

Find your endpoint

Search the public contract and copy the request in your language.

Open API reference ↗