ilovepsxAPI
Data quality / Reliable repeated reads

Cache Fund API Responses and Handle Rate Limits and Corrections

Integrate the Pakistan fund API with weighted rate limits, bounded retries, cautious ETag handling and explicit reconciliation for corrected data.

On this page

A reliable fund-data integration controls repeated reads without hiding old observations or retrying indefinitely. The cache entry, the observation date and the API allowance describe different things and should remain separate in your application.

This guide follows the current ILovePSX public implementation: unlimited monthly usage under the free offer, weighted burst protection, response cache headers and a change-event feed. It also explains a limitation of the current ETag representation so you can design for measured behavior rather than assumed savings.

The useful part, upfront.

  • Budget weighted cost units, not an assumed 600 requests per minute.
  • Treat 304 correctly, but do not promise it when changing response metadata changes the ETag.
  • Combine published update events with bounded data reconciliation.

Read the allowance as weighted units#

The current customer offer is free with unlimited monthly usage and 600 weighted units per minute of burst protection. Standard public reads cost one unit, complete FMR reads cost two and VPS FMR reads cost three. Bulk operations have their own costs. The current weights are part of the implementation contract and should be rechecked when designing a production workload.

The response headers RateLimit-Limit and RateLimit-Remaining describe the weighted minute allowance. RateLimit-Reset is the Unix timestamp of the next minute boundary in the current implementation, rather than a duration you can blindly sleep for. Monthly headers can say unlimited under the free policy. Several key types or scopes do not justify attempts to evade the published protection by rotating identities.

Current operation classWeighted unitsPlanning implication
Standard read1Bound concurrency and coalesce repeated reads
Complete FMR2Do not equate calls with cost units
VPS FMR3Budget for deeper report retrieval
POST bulk fund / NAV / snapshots2 / 3 / 5Check the exact operation, not just its name

References: ILovePSX authentication, scopes and limits · ILovePSX public API reference

Key application caches by selection and access context#

Define a cache identity from method, fixed host, resource path, query selection and the appropriate customer or authorization context. Preserve repeated query parameters correctly. Complete FMR reads with include=all differ from default-expansion reads, and two NAV selections with different date ranges must not share an entry. Avoid putting a raw API key into cache keys, log lines or analytics events.

Authentication still happens before a public API read is served. Some data responses advertise public max-age values, while others are private with max-age=0. Those headers describe response caching policy; they do not mean a caller can omit the key or that private account responses should be shared across users. Keep customer and credential-management routes out of any public data cache.

References: ILovePSX public API reference · RFC 9110: HTTP conditional reads and Retry-After

Keep cache age separate from source freshness#

A response cached thirty seconds ago can contain a NAV from several days earlier. Store fetched_at for your cache lifecycle and preserve nav_date, report_date and meta.data_as_of for the facts. Display the observation period beside the value. A successful cache hit must never update the source date to today's date.

The current latest NAV route advertises public max-age=60, and the NAV history route advertises public max-age=300. Those durations are not an agreement that the underlying facts change exactly at that interval. Internal query-cache TTL settings are another layer and should not be presented as guaranteed source freshness. Measure response behavior and apply a refresh cadence appropriate to the product's use.

References: ILovePSX public API reference

Handle ETag conditionals without promising reliable 304 savings#

The success response currently builds an ETag from the serialized envelope, including request_id and generated_at. Those metadata values normally change between requests, so an unchanged underlying dataset can still produce a different ETag. The server contains an If-None-Match equality check, but this implementation does not justify promising that ordinary repeated reads will consistently return 304.

A client may retain the returned ETag and send If-None-Match. It must still handle a full 200 response. If a 304 does occur, reuse the previously stored body and never attempt to parse the empty 304 body as JSON. A 304 without a retained representation is a local cache error. Evaluate hit rates before relying on conditional requests for bandwidth or allowance planning.

Current implementation limitation

Changing envelope metadata is part of the ETag hash. Conditional-read support is not a dependable unchanged-data validator in this release.

References: ILovePSX public API reference · RFC 9110: HTTP conditional reads and Retry-After

Use bounded retries and respect Retry-After#

A 429 response provides Retry-After. The current rate-limit rejection uses a delay in seconds; the helper below also accepts an HTTP date. It retries only a short list of transient status codes and stops after a defined attempt count. Permanent authentication, scope and input failures are returned to the caller immediately.

Save the following as api_retry.py and use read_json for a fixed private data URL. The key comes from ILOVEPSX_API_KEY. The function refuses redirects and never logs request headers. Pass a retained cached body only with the ETag that came from that body. Its five-minute local wait ceiling is an application choice: a longer server instruction becomes a visible deferred operation instead of being shortened into an early retry.

api_retry.py · bounded reads and conditional response handling
import json
import os
import random
import time
from datetime import datetime, timezone
from email.utils import parsedate_to_datetime
from urllib.error import HTTPError
from urllib.parse import urlsplit
from urllib.request import HTTPRedirectHandler, Request, build_opener

class NoRedirect(HTTPRedirectHandler):
    def redirect_request(self, request, fp, code, message, headers, newurl):
        return None

def retry_delay(value, attempt, now=None):
    if value is not None:
        if value.strip().isdigit():
            return float(value.strip())
        try:
            target = parsedate_to_datetime(value)
            if target.tzinfo is None:
                target = target.replace(tzinfo=timezone.utc)
            return max(0.0, (target - (now or datetime.now(timezone.utc))).total_seconds())
        except (TypeError, ValueError, OverflowError):
            pass
    return min(30.0, 2 ** attempt) + random.random()

def read_json(url, cached=None, etag=None, attempts=3):
    parsed = urlsplit(url)
    if (parsed.scheme, parsed.netloc) != ("https", "funds.api.ilovepsx.com"):
        raise ValueError("Use the fixed fund API host.")
    if not parsed.path.startswith("/v1/mutual-funds/") or parsed.fragment:
        raise ValueError("Use a documented mutual fund data URL.")
    opener = build_opener(NoRedirect)
    headers = {"X-API-Key": os.environ["ILOVEPSX_API_KEY"]}
    if etag is not None and cached is not None:
        headers["If-None-Match"] = etag
    for attempt in range(attempts):
        try:
            with opener.open(Request(url, headers=headers), timeout=25) as response:
                return json.load(response), response.headers.get("ETag"), "200"
        except HTTPError as error:
            if error.code == 304:
                if cached is None:
                    raise RuntimeError("304 received without a cached body.") from None
                return cached, etag, "304"
            if error.code not in {429, 502, 503, 504} or attempt == attempts - 1:
                raise RuntimeError("Read failed: HTTP " + str(error.code)) from None
            delay = retry_delay(error.headers.get("Retry-After"), attempt)
            if delay > 300:
                raise RuntimeError("Retry is deferred beyond this job's wait budget.") from None
            time.sleep(delay)
    raise ValueError("attempts must be a positive integer")

References: ILovePSX authentication, scopes and limits · RFC 9110: HTTP conditional reads and Retry-After

Choose the action that matches the failure#

A request error is not a missing observation. If a secret is expired or revoked, refresh access through the customer's approved key controls; retries alone will not fix it. If a key lacks fmr:read, widening a date range is unrelated. For a 422, inspect parameters and use the documented bound before sending another request.

Keep the request ID from a failed response for troubleshooting without recording the key. The helper reports only status because it is a minimal integration example; a production wrapper can retain safe request IDs and selected diagnostics. Network exceptions are not automatically retried by this helper, so your outer job can decide whether it has time for another complete attempt.

Status or stateInterpretationAction
401 / 403Credential or scope problemResolve access; stop automatic retries
404Requested identity or resource missingCheck identity and period
422Invalid selectionCorrect parameters
429Allowance exceededRespect Retry-After; bound the job
502 / 503 / 504Potential transient service failureBounded retry or defer
200 with empty dataSuccessful empty selectionShow absence; do not show zero

References: ILovePSX public API reference

Process update events as hints and reconcile facts#

GET /v1/mutual-funds/updates requires updates:read and returns events under data with meta.next_cursor. Preserve the event ID for idempotence and keep dataset, resource identity, effective_date, occurred_at, data_version and payload where applicable. Follow continuation cursors until that traversal ends. Re-fetch the affected documented resource under your application's normal access rules.

A published feed is subject to retention and dataset coverage, so do not claim it represents every historical correction. The current cursor is emitted only when another page exists; a terminal null is not a durable incremental checkpoint token. Retain event IDs, revisit and deduplicate the retained feed as needed, and use periodic bounded reconciliation. Never fabricate a sequence cursor from internal integers or assume webhook delivery guarantees that were not verified.

References: ILovePSX public API reference

Invalidate derived portfolio views when report facts change#

A report correction can affect much more than a title. Profiles, reported performance, holdings, asset allocations, sector composition and credit-quality rows can all participate in downstream views. Keep report_date and data_version in your dataset and rebuild the dependent projection when its input changes. Preserve the previous import for auditability where your retention policy permits.

Do not repair a changed holding by silently normalizing every portfolio percentage back to 100. Preserve the reported denominator and known section state, then re-run your own validation. A missing section, a corrected value and a newly available disclosure need different UI states. The most reliable cache is one whose identity, refresh policy and invalidation dependencies another developer can explain.

References: ILovePSX public API reference

MOCK DATA / REAL RESPONSE STRUCTURE

Try a complete example.

Use these fictional records to prototype a full fund view: profile, reported returns, holdings, asset and sector allocations, credit quality, fees and ratings. Every name, identifier and number is invented. This is educational mock data, with no connection to a real fund, source document or agency opinion.

The JSON mirrors the public response structure. The complete FMR example includes all supported expansions; empty arrays and nulls demonstrate valid missing-data states. Your live integration must still request the sections it needs and check the returned coverage.

Inspect the complete FMR model
Complete synthetic FMR response · fictional data
{
  "success": true,
  "data": {
    "id": "00000000-0000-4000-8000-000000000101",
    "report_ids": [
      "00000000-0000-4000-8000-000000000101"
    ],
    "fund": {
      "id": "00000000-0000-4000-8000-000000000201",
      "slug": "example-research-fund",
      "name": "Example Research Fund",
      "mufap_fund_id": null,
      "amc": {
        "id": "00000000-0000-4000-8000-000000000301",
        "slug": "example-asset-management",
        "name": "Example Asset Management"
      }
    },
    "report_date": "2026-09-30",
    "currency": "PKR",
    "data_version": 1,
    "identity": {
      "fund_name_as_reported": "Example Research Fund",
      "fund_short_name_as_reported": "ERF",
      "parent_fund_name_as_reported": null,
      "plan_name_as_reported": null,
      "fund_type_as_reported": "Open-end",
      "category_as_reported": "Illustrative mixed-asset category",
      "risk_profile_as_reported": "Illustrative higher-risk profile",
      "is_shariah_compliant": false,
      "is_plan": false,
      "is_pension_scheme": false,
      "is_etf": false
    },
    "fund_size": {
      "nav_per_unit": "100.500000",
      "nav_date": "2026-09-30",
      "offer_price": "100.500000",
      "redemption_price": "100.500000",
      "repurchase_price": "100.500000",
      "market_price": null,
      "net_assets_pkr": "1005000000.0000",
      "fund_size_pkr": "1005000000.0000",
      "fund_size_including_fof_pkr": "1005000000.0000",
      "fund_size_excluding_fof_pkr": "1005000000.0000",
      "amount_invested_by_fof_pkr": "0.0000",
      "units_outstanding": "10000000.000000"
    },
    "profile": {
      "launch_date": "2025-01-01",
      "inception_date": "2025-01-01",
      "maturity_date": null,
      "benchmark": "Example composite benchmark",
      "old_benchmark": null,
      "new_benchmark": null,
      "benchmark_effective_date": null,
      "risk_of_principal_erosion": "Principal may fluctuate; synthetic disclosure.",
      "pricing_mechanism": "Forward pricing — illustrative",
      "dealing_days": "Monday to Friday — illustrative",
      "dealing_time": "09:00 to 14:00 Pakistan time — illustrative",
      "cutoff_time": "14:00 Pakistan time — illustrative",
      "settlement_period": "T+2 — illustrative, not an actual dealing policy",
      "minimum_initial_investment_pkr": "5000.0000",
      "minimum_subsequent_investment_pkr": "1000.0000",
      "minimum_redemption_pkr": "1000.0000",
      "unit_classes": [
        "Illustrative standard units"
      ],
      "leverage": "None in this synthetic example"
    },
    "report_fragments": [
      {
        "id": "00000000-0000-4000-8000-000000000101",
        "page_number": 1,
        "schema_version": "fmr_page_v3",
        "data_version": 1,
        "promoted_at": "2026-10-08T08:00:00Z",
        "report_date": "2026-09-30",
        "report_month": "September 2026",
        "page_type": "FUND_REPORT",
        "extraction_mode": "PROFILE_PERFORMANCE_PORTFOLIO",
        "amc_name_raw": "Example Asset Management",
        "fund_name_raw": "Example Research Fund",
        "fund_short_name_raw": "ERF",
        "parent_fund_name_raw": null,
        "plan_name_raw": null,
        "fund_type_raw": "Open-end",
        "category_raw": "Illustrative mixed-asset category",
        "risk_profile_raw": "Illustrative higher-risk profile",
        "risk_of_principal_erosion_raw": "Principal may fluctuate; synthetic disclosure.",
        "is_shariah_compliant": false,
        "is_plan": false,
        "is_pension_scheme": false,
        "is_etf": false,
        "launch_date": "2025-01-01",
        "inception_date": "2025-01-01",
        "maturity_date": null,
        "benchmark_raw": "Example composite benchmark",
        "old_benchmark_raw": null,
        "new_benchmark_raw": null,
        "benchmark_effective_date": null,
        "par_value": "100.000000",
        "listing_raw": null,
        "leverage_raw": "None in this synthetic example",
        "nav_per_unit": "100.500000",
        "nav_date": "2026-09-30",
        "offer_price": "100.500000",
        "redemption_price": "100.500000",
        "repurchase_price": "100.500000",
        "market_price": null,
        "net_assets": "1005000000.0000",
        "fund_size": "1005000000.0000",
        "fund_size_including_fof": "1005000000.0000",
        "fund_size_excluding_fof": "1005000000.0000",
        "amount_invested_by_fof": "0.0000",
        "units_outstanding": "10000000.000000",
        "currency": "PKR",
        "pricing_mechanism_raw": "Forward pricing — illustrative",
        "dealing_days_raw": "Monday to Friday — illustrative",
        "dealing_time_raw": "09:00 to 14:00 Pakistan time — illustrative",
        "cutoff_time_raw": "14:00 Pakistan time — illustrative",
        "settlement_period_raw": "T+2 — illustrative, not an actual dealing policy",
        "minimum_initial_investment": "5000.0000",
        "minimum_subsequent_investment": "1000.0000",
        "minimum_redemption": "1000.0000",
        "unit_classes": [
          "Illustrative standard units"
        ]
      }
    ],
    "sub_funds": [],
    "reported_returns": [
      {
        "sub_fund_key": null,
        "sub_fund_name_raw": null,
        "row_order": 1,
        "report_id": "00000000-0000-4000-8000-000000000101",
        "page_number": 1,
        "period_label_raw": "1 year",
        "period_key": "1Y",
        "fund_return_percent": "12.00000000",
        "benchmark_return_percent": "10.00000000",
        "peer_return_percent": null,
        "return_type": "ABSOLUTE",
        "is_annualized": false,
        "is_since_inception": false,
        "calculation_basis_raw": "Synthetic cumulative return for the stated period"
      },
      {
        "sub_fund_key": null,
        "sub_fund_name_raw": null,
        "row_order": 2,
        "report_id": "00000000-0000-4000-8000-000000000101",
        "page_number": 1,
        "period_label_raw": "Month to date",
        "period_key": "MTD",
        "fund_return_percent": "0.50000000",
        "benchmark_return_percent": "0.40000000",
        "peer_return_percent": null,
        "return_type": "ABSOLUTE",
        "is_annualized": false,
        "is_since_inception": false,
        "calculation_basis_raw": "Synthetic cumulative September return"
      }
    ],
    "allocations": [
      {
        "sub_fund_key": null,
        "sub_fund_name_raw": null,
        "row_order": 1,
        "report_id": "00000000-0000-4000-8000-000000000101",
        "page_number": 1,
        "allocation_type": "ASSET_ALLOCATION",
        "label_raw": "Equities",
        "label_normalized": null,
        "percent_of_total_assets": "60.000000",
        "percent_of_net_assets": null,
        "percent_of_gross_assets": null,
        "amount": "603000000.0000",
        "current_period": null,
        "previous_period": null,
        "change_percent": null,
        "bucket_start_days": null,
        "bucket_end_days": null,
        "bucket_start_years": null,
        "bucket_end_years": null
      },
      {
        "sub_fund_key": null,
        "sub_fund_name_raw": null,
        "row_order": 2,
        "report_id": "00000000-0000-4000-8000-000000000101",
        "page_number": 1,
        "allocation_type": "ASSET_ALLOCATION",
        "label_raw": "Cash",
        "label_normalized": null,
        "percent_of_total_assets": "20.000000",
        "percent_of_net_assets": null,
        "percent_of_gross_assets": null,
        "amount": "201000000.0000",
        "current_period": null,
        "previous_period": null,
        "change_percent": null,
        "bucket_start_days": null,
        "bucket_end_days": null,
        "bucket_start_years": null,
        "bucket_end_years": null
      },
      {
        "sub_fund_key": null,
        "sub_fund_name_raw": null,
        "row_order": 3,
        "report_id": "00000000-0000-4000-8000-000000000101",
        "page_number": 1,
        "allocation_type": "ASSET_ALLOCATION",
        "label_raw": "Government securities",
        "label_normalized": null,
        "percent_of_total_assets": "15.000000",
        "percent_of_net_assets": null,
        "percent_of_gross_assets": null,
        "amount": "150750000.0000",
        "current_period": null,
        "previous_period": null,
        "change_percent": null,
        "bucket_start_days": null,
        "bucket_end_days": null,
        "bucket_start_years": null,
        "bucket_end_years": null
      },
      {
        "sub_fund_key": null,
        "sub_fund_name_raw": null,
        "row_order": 4,
        "report_id": "00000000-0000-4000-8000-000000000101",
        "page_number": 1,
        "allocation_type": "ASSET_ALLOCATION",
        "label_raw": "Other assets",
        "label_normalized": null,
        "percent_of_total_assets": "5.000000",
        "percent_of_net_assets": null,
        "percent_of_gross_assets": null,
        "amount": "50250000.0000",
        "current_period": null,
        "previous_period": null,
        "change_percent": null,
        "bucket_start_days": null,
        "bucket_end_days": null,
        "bucket_start_years": null,
        "bucket_end_years": null
      },
      {
        "sub_fund_key": null,
        "sub_fund_name_raw": null,
        "row_order": 5,
        "report_id": "00000000-0000-4000-8000-000000000101",
        "page_number": 1,
        "allocation_type": "SECTOR_ALLOCATION",
        "label_raw": "Technology",
        "label_normalized": null,
        "percent_of_total_assets": "25.000000",
        "percent_of_net_assets": null,
        "percent_of_gross_assets": null,
        "amount": "251250000.0000",
        "current_period": null,
        "previous_period": null,
        "change_percent": null,
        "bucket_start_days": null,
        "bucket_end_days": null,
        "bucket_start_years": null,
        "bucket_end_years": null
      },
      {
        "sub_fund_key": null,
        "sub_fund_name_raw": null,
        "row_order": 6,
        "report_id": "00000000-0000-4000-8000-000000000101",
        "page_number": 1,
        "allocation_type": "SECTOR_ALLOCATION",
        "label_raw": "Fertilizer",
        "label_normalized": null,
        "percent_of_total_assets": "20.000000",
        "percent_of_net_assets": null,
        "percent_of_gross_assets": null,
        "amount": "201000000.0000",
        "current_period": null,
        "previous_period": null,
        "change_percent": null,
        "bucket_start_days": null,
        "bucket_end_days": null,
        "bucket_start_years": null,
        "bucket_end_years": null
      },
      {
        "sub_fund_key": null,
        "sub_fund_name_raw": null,
        "row_order": 7,
        "report_id": "00000000-0000-4000-8000-000000000101",
        "page_number": 1,
        "allocation_type": "SECTOR_ALLOCATION",
        "label_raw": "Banks",
        "label_normalized": null,
        "percent_of_total_assets": "15.000000",
        "percent_of_net_assets": null,
        "percent_of_gross_assets": null,
        "amount": "150750000.0000",
        "current_period": null,
        "previous_period": null,
        "change_percent": null,
        "bucket_start_days": null,
        "bucket_end_days": null,
        "bucket_start_years": null,
        "bucket_end_years": null
      },
      {
        "sub_fund_key": null,
        "sub_fund_name_raw": null,
        "row_order": 8,
        "report_id": "00000000-0000-4000-8000-000000000101",
        "page_number": 1,
        "allocation_type": "CREDIT_QUALITY",
        "label_raw": "Government securities — illustrative bucket",
        "label_normalized": null,
        "percent_of_total_assets": "15.000000",
        "percent_of_net_assets": null,
        "percent_of_gross_assets": null,
        "amount": null,
        "current_period": null,
        "previous_period": null,
        "change_percent": null,
        "bucket_start_days": null,
        "bucket_end_days": null,
        "bucket_start_years": null,
        "bucket_end_years": null
      },
      {
        "sub_fund_key": null,
        "sub_fund_name_raw": null,
        "row_order": 9,
        "report_id": "00000000-0000-4000-8000-000000000101",
        "page_number": 1,
        "allocation_type": "CREDIT_QUALITY",
        "label_raw": "Unrated / no rating assigned in this example",
        "label_normalized": null,
        "percent_of_total_assets": "85.000000",
        "percent_of_net_assets": null,
        "percent_of_gross_assets": null,
        "amount": null,
        "current_period": null,
        "previous_period": null,
        "change_percent": null,
        "bucket_start_days": null,
        "bucket_end_days": null,
        "bucket_start_years": null,
        "bucket_end_years": null
      }
    ],
    "holdings": [
      {
        "sub_fund_key": null,
        "sub_fund_name_raw": null,
        "row_order": 1,
        "report_id": "00000000-0000-4000-8000-000000000101",
        "page_number": 1,
        "holding_group": "TOP_HOLDINGS",
        "rank": 1,
        "name_raw": "Example Technology Company",
        "holding_type": "EQUITY",
        "asset_class": "Equities",
        "issuer_name_raw": "Example Technology Company",
        "security_name_raw": "Example Technology Company ordinary shares",
        "symbol_raw": "EXTECH",
        "sector_raw": "Technology",
        "percent_of_total_assets": "18.000000",
        "percent_of_net_assets": null,
        "percent_of_gross_assets": null,
        "percent_held": null,
        "market_value": "180900000.0000",
        "value_before_provisioning": null,
        "provisioning_amount": null,
        "value_after_provisioning": null,
        "quantity": "1000000.000000",
        "units": "shares",
        "credit_rating": null,
        "rating_agency": null,
        "instrument_type_raw": "Ordinary shares",
        "coupon_rate": null,
        "yield_percent": null,
        "ytm_percent": null,
        "issue_date": null,
        "maturity_date": null,
        "listed_or_unlisted": "Listed — illustrative",
        "secured_or_unsecured": null,
        "is_shariah_compliant": null,
        "is_top_holding": true,
        "is_non_compliant": null
      },
      {
        "sub_fund_key": null,
        "sub_fund_name_raw": null,
        "row_order": 2,
        "report_id": "00000000-0000-4000-8000-000000000101",
        "page_number": 1,
        "holding_group": "TOP_HOLDINGS",
        "rank": 2,
        "name_raw": "Example Fertilizer Company",
        "holding_type": "EQUITY",
        "asset_class": "Equities",
        "issuer_name_raw": "Example Fertilizer Company",
        "security_name_raw": "Example Fertilizer Company ordinary shares",
        "symbol_raw": "EXFERT",
        "sector_raw": "Fertilizer",
        "percent_of_total_assets": "12.000000",
        "percent_of_net_assets": null,
        "percent_of_gross_assets": null,
        "percent_held": null,
        "market_value": "120600000.0000",
        "value_before_provisioning": null,
        "provisioning_amount": null,
        "value_after_provisioning": null,
        "quantity": "800000.000000",
        "units": "shares",
        "credit_rating": null,
        "rating_agency": null,
        "instrument_type_raw": "Ordinary shares",
        "coupon_rate": null,
        "yield_percent": null,
        "ytm_percent": null,
        "issue_date": null,
        "maturity_date": null,
        "listed_or_unlisted": "Listed — illustrative",
        "secured_or_unsecured": null,
        "is_shariah_compliant": null,
        "is_top_holding": true,
        "is_non_compliant": null
      },
      {
        "sub_fund_key": null,
        "sub_fund_name_raw": null,
        "row_order": 3,
        "report_id": "00000000-0000-4000-8000-000000000101",
        "page_number": 1,
        "holding_group": "TOP_HOLDINGS",
        "rank": 3,
        "name_raw": "Example Banking Company",
        "holding_type": "EQUITY",
        "asset_class": "Equities",
        "issuer_name_raw": "Example Banking Company",
        "security_name_raw": "Example Banking Company ordinary shares",
        "symbol_raw": "EXBANK",
        "sector_raw": "Banks",
        "percent_of_total_assets": "8.000000",
        "percent_of_net_assets": null,
        "percent_of_gross_assets": null,
        "percent_held": null,
        "market_value": "80400000.0000",
        "value_before_provisioning": null,
        "provisioning_amount": null,
        "value_after_provisioning": null,
        "quantity": "500000.000000",
        "units": "shares",
        "credit_rating": null,
        "rating_agency": null,
        "instrument_type_raw": "Ordinary shares",
        "coupon_rate": null,
        "yield_percent": null,
        "ytm_percent": null,
        "issue_date": null,
        "maturity_date": null,
        "listed_or_unlisted": "Listed — illustrative",
        "secured_or_unsecured": null,
        "is_shariah_compliant": null,
        "is_top_holding": true,
        "is_non_compliant": null
      }
    ],
    "metrics": [
      {
        "sub_fund_key": null,
        "sub_fund_name_raw": null,
        "row_order": 1,
        "report_id": "00000000-0000-4000-8000-000000000101",
        "page_number": 1,
        "metric_key": "NUMBER_OF_HOLDINGS",
        "label_raw": "Illustrative number of equity holdings",
        "value": "12.00000000",
        "unit": "count",
        "period": "September 2026",
        "benchmark_value": null
      }
    ],
    "fees": [
      {
        "sub_fund_key": null,
        "sub_fund_name_raw": null,
        "row_order": 1,
        "report_id": "00000000-0000-4000-8000-000000000101",
        "page_number": 1,
        "fee_type": "TOTAL_EXPENSE_RATIO",
        "label_raw": "Illustrative annualized total expense ratio",
        "value_percent": "2.000000",
        "value_amount": null,
        "currency": "PKR",
        "period": "September 2026 — annualized illustration",
        "with_government_levies": true,
        "government_levy_percent": null,
        "secp_fee_percent": null,
        "is_actual_charged": true,
        "is_maximum_allowed": false
      }
    ],
    "ratings": [
      {
        "sub_fund_key": null,
        "sub_fund_name_raw": null,
        "row_order": 1,
        "report_id": "00000000-0000-4000-8000-000000000101",
        "page_number": 1,
        "rating_type": "ILLUSTRATIVE",
        "rating_raw": "Illustrative rating — not an agency opinion",
        "rating_agency": "Example agency (fictional)",
        "rating_date": null,
        "outlook_raw": null
      }
    ],
    "parties": [
      {
        "sub_fund_key": null,
        "sub_fund_name_raw": null,
        "row_order": 1,
        "report_id": "00000000-0000-4000-8000-000000000101",
        "page_number": 1,
        "role": "FUND_MANAGER",
        "name_raw": "Example Research Team",
        "designation_raw": "Illustrative fund-management team",
        "organization_raw": "Example Asset Management"
      }
    ],
    "special_terms": [
      {
        "sub_fund_key": null,
        "sub_fund_name_raw": null,
        "row_order": 1,
        "report_id": "00000000-0000-4000-8000-000000000101",
        "page_number": 1,
        "term_type": "INVESTMENT_OBJECTIVE",
        "label_raw": "Illustrative investment objective",
        "value_raw": "A fictional mixed-asset portfolio used only to demonstrate the response model.",
        "value_numeric": null,
        "value_percent": null,
        "value_amount": null,
        "value_date": null,
        "currency": "PKR"
      }
    ],
    "compliance": [
      {
        "sub_fund_key": null,
        "sub_fund_name_raw": null,
        "row_order": 1,
        "report_id": "00000000-0000-4000-8000-000000000101",
        "page_number": 1,
        "compliance_type": "ILLUSTRATIVE_DISCLOSURE",
        "name_raw": "Synthetic compliance disclosure",
        "limit_type_raw": null,
        "regulatory_limit_percent": null,
        "actual_exposure_percent": null,
        "excess_percent": null,
        "gross_assets_percent": null,
        "net_assets_percent": null,
        "status_raw": "Illustrative only — no regulatory assessment has been performed"
      }
    ],
    "notes": [
      {
        "sub_fund_key": null,
        "sub_fund_name_raw": null,
        "row_order": 1,
        "report_id": "00000000-0000-4000-8000-000000000101",
        "page_number": 1,
        "note_kind": "NOTE",
        "section_type": "PORTFOLIO",
        "note_type": "ILLUSTRATIVE",
        "text": "All figures and entities are synthetic. The three reported top holdings are a partial list. Sector percentages use total assets. Credit-quality labels and rating text are not agency opinions."
      }
    ],
    "source": [
      {
        "report_id": "00000000-0000-4000-8000-000000000101",
        "page_number": 1,
        "document": null,
        "promoted_at": "2026-10-08T08:00:00Z",
        "data_version": 1
      }
    ],
    "sections": {
      "sub_funds": {
        "status": "NOT_REPORTED",
        "row_count": 0
      },
      "reported_returns": {
        "status": "AVAILABLE",
        "row_count": 2
      },
      "allocations": {
        "status": "AVAILABLE",
        "row_count": 9
      },
      "holdings": {
        "status": "AVAILABLE",
        "row_count": 3
      },
      "metrics": {
        "status": "AVAILABLE",
        "row_count": 1
      },
      "fees": {
        "status": "AVAILABLE",
        "row_count": 1
      },
      "ratings": {
        "status": "AVAILABLE",
        "row_count": 1
      },
      "parties": {
        "status": "AVAILABLE",
        "row_count": 1
      },
      "special_terms": {
        "status": "AVAILABLE",
        "row_count": 1
      },
      "compliance": {
        "status": "AVAILABLE",
        "row_count": 1
      },
      "notes": {
        "status": "AVAILABLE",
        "row_count": 1
      },
      "source": {
        "status": "AVAILABLE",
        "row_count": 1
      }
    },
    "available_expansions": [
      "allocations",
      "compliance",
      "fees",
      "holdings",
      "metrics",
      "notes",
      "parties",
      "ratings",
      "reported_returns",
      "source",
      "special_terms",
      "sub_funds"
    ]
  },
  "meta": {
    "request_id": "00000000000040008000000000000401",
    "generated_at": "2026-10-08T08:00:00Z",
    "data_as_of": "2026-09-30",
    "data_freshness_days": 8
  }
}
Inspect the latest NAV model
Synthetic latest NAV response · fictional data
{
  "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
  }
}
TRACE THE EVIDENCE

Sources & further reading

Check the published contract for current fields and limits. Source documents describe reported facts; API availability still depends on promoted production coverage.

  1. ILovePSX public API reference
  2. ILovePSX authentication, scopes and limits
  3. RFC 9110: HTTP conditional reads and Retry-After

Put the guide to work.

Start with the documented contract, keep your key server-side, and make dates and missing data visible in your product.

Review current integration limits