### Makefile: Project Build and Development Commands Source: https://github.com/rishikeshsreehari/npsnav/blob/main/README.md This Makefile defines common commands for managing the NPSNAV.in project, including dependency installation, building the static site, serving locally, cleaning artifacts, deploying, and updating content. ```makefile .PHONY: install build serve clean dev deploy update # Install dependencies install: uv sync # Build the static site build: uv run scripts/build.py # Build the site quickly without full build quick: uv run scripts/main.py # Serve the site locally serve: uv run scripts/serve_local.py # Clean build artifacts clean: rm -rf public # Default development flow: build and serve dev: build serve # Deploy to Cloudflare deploy: npx wrangler pages deploy public # Update content: fetch new data, build, and deploy update: uv run scripts/fetch.py $(MAKE) build $(MAKE) deploy ``` -------------------------------- ### GET /api/detailed/{schemeCode} - Detailed Fund Data Source: https://github.com/rishikeshsreehari/npsnav/blob/main/src/content/nps-api.html Fetches detailed performance metrics, including returns from 1-day to 5-year, for a specific fund identified by its scheme code. ```APIDOC ## GET /api/detailed/{schemeCode} ### Description Get performance metrics including 1-day to 5-year returns for a specific fund. ### Method GET ### Endpoint https://npsnav.in/api/detailed/{schemeCode} ### Parameters #### Path Parameters - **schemeCode** (string) - Required - The unique code for the NPS scheme. #### Query Parameters None ### Request Example None (GET request) ### Response #### Success Response (200) - **Last Updated** (string) - The date of the last update. - **PFM Code** (string) - The Pension Fund Manager Code. - **PFM Name** (string) - The Pension Fund Manager Name. - **Scheme Code** (string) - The NPS Scheme Code. - **Scheme Name** (string) - The NPS Scheme Name. - **NAV** (string) - The current Net Asset Value. - **1D** (string) - 1-day return percentage. - **7D** (string) - 7-day return percentage. - **1M** (string) - 1-month return percentage. - **3M** (string) - 3-month return percentage. - **6M** (string) - 6-month return percentage. - **1Y** (string) - 1-year return percentage. - **3Y** (string) - 3-year return percentage. - **5Y** (string) - 5-year return percentage. #### Response Example ```json { "Last Updated": "01-10-2024", "PFM Code": "PFM001", "PFM Name": "SBI PENSION FUNDS PRIVATE LIMITED", "Scheme Code": "SM001001", "Scheme Name": "SBI PENSION FUND SCHEME - CENTRAL GOVT", "NAV": "46.7686", "1D": "0.10", "7D": "0.13", "1M": "1.34", "3M": "3.51", "6M": "6.73", "1Y": "13.98", "3Y": "8.16", "5Y": "9.23" } ``` ``` -------------------------------- ### GET /api/latest-min - Minimal Format Source: https://github.com/rishikeshsreehari/npsnav/blob/main/src/content/nps-api.html Retrieves a lightweight version of the data containing only Scheme Code and NAV. ```APIDOC ## GET /api/latest-min ### Description Retrieves a lighter, faster version of the data containing only Scheme Code and NAV. ### Method GET ### Endpoint https://npsnav.in/api/latest-min ### Parameters #### Query Parameters None ### Request Example None (GET request) ### Response #### Success Response (200) - **data** (array of arrays) - Array where each inner array contains Scheme Code (string) and NAV (float). - **metadata** (object) - Contains count (integer) and lastUpdated (string). #### Response Example ```json { "data": [ ["SM001001", 46.7686], ["SM008001", 93.4021] ], "metadata": { "count": 151, "lastUpdated": "01-10-2024" } } ``` ``` -------------------------------- ### GET /api/historical/{schemeCode} - Historical NAV Data Source: https://github.com/rishikeshsreehari/npsnav/blob/main/src/content/nps-api.html Provides access to historical Net Asset Values (NAV) for a specific fund, allowing users to track investment performance over time. ```APIDOC ## GET /api/historical/{schemeCode} ### Description Access past NAV values to track the historical performance of your investments. ### Method GET ### Endpoint https://npsnav.in/api/historical/{schemeCode} ### Parameters #### Path Parameters - **schemeCode** (string) - Required - The unique code for the NPS scheme. #### Query Parameters None ### Request Example None (GET request) ### Response #### Success Response (200) - **data** (array of objects) - Array where each object contains 'date' (string) and 'nav' (float). - **metadata** (object) - Contains 'currency' (string), 'dataType' (string), and 'lastUpdated' (string). #### Response Example ```json { "data": [ { "date": "01-10-2024", "nav": 46.7686 }, { "date": "30-09-2024", "nav": 46.7231 } ], "metadata": { "currency": "INR", "dataType": "NAV", "lastUpdated": "01-10-2024" } } ``` ``` -------------------------------- ### Get Latest NPS NAV Source: https://github.com/rishikeshsreehari/npsnav/blob/main/src/content/nps-nav-excel.html This endpoint retrieves the latest Net Asset Value (NAV) for a specified NPS scheme. It is designed to be used with Excel's WEBSERVICE function for real-time data retrieval. ```APIDOC ## GET /api/SchemeCode ### Description Fetches the latest Net Asset Value (NAV) for a given NPS scheme. ### Method GET ### Endpoint `/api/SchemeCode` ### Parameters #### Path Parameters - **SchemeCode** (string) - Required - The unique identifier for the NPS scheme. ### Request Example ``` =WEBSERVICE("https://npsnav.in/api/SM001001") ``` ### Response #### Success Response (200) - **nav** (number) - The latest Net Asset Value of the scheme. #### Response Example ```json { "scheme_code": "SM001001", "nav": 185.50, "date": "2023-10-27" } ``` ``` -------------------------------- ### Get Historical NPS NAV Source: https://github.com/rishikeshsreehari/npsnav/blob/main/src/content/nps-nav-sheets.html Retrieve historical Net Asset Value (NAV) data for a specific NPS scheme on a given date. This endpoint allows for performance tracking and reporting over time, usable within Google Sheets. ```APIDOC ## GET /api/historical/SchemeCode ### Description Fetches historical Net Asset Value (NAV) data for a specified NPS scheme code. It returns the NAV for the most recent date on or before the target date if an exact match is not found. ### Method GET ### Endpoint `/api/historical/SchemeCode` ### Parameters #### Path Parameters - **SchemeCode** (string) - Required - The unique identifier for the NPS scheme (e.g., "SM010001"). #### Query Parameters - **date** (string) - Required - The target date for which to retrieve the NAV. Should be in a format recognizable by Google Sheets (e.g., "5/5/2025"). ### Request Example ``` =LET( import, IMPORTDATA("https://npsnav.in/api/historical/SM010001?date=5/5/2025", ":"), dates, ARRAYFORMULA(VALUE(SUBSTITUTE(CHOOSECOLS(import,2), ",", ""))), INDEX(CHOOSECOLS(import,2), XMATCH(B1, dates, -1, 1)+1) ) ``` ### Response #### Success Response (200) - **NAV** (number) - The Net Asset Value of the NPS scheme on the specified or closest preceding date. #### Response Example ```json { "date": "2025-05-05", "NAV": 30.50 } ``` ``` -------------------------------- ### Get Latest NAV for All Funds Source: https://github.com/rishikeshsreehari/npsnav/blob/main/src/content/nps-api.html Fetch the most recent NAV values for every NPS fund in a single request. This endpoint provides detailed information including PFM Name, Scheme Name, NAV, and Last Updated Date. ```APIDOC ## Get Latest NAV for All Funds ### Description Fetch the most recent NAV values for **every NPS fund** in a single request. This endpoint provides detailed information including PFM Name, Scheme Name, NAV, and Last Updated Date. ### Method GET ### Endpoint https://npsnav.in/api/latest ### Parameters #### Query Parameters N/A #### Request Body N/A ### Response #### Success Response (200) - **data** (array of objects) - An array of objects, where each object represents an NPS fund. - **PFM Code** (string) - The Pension Fund Manager code. - **PFM Name** (string) - The Pension Fund Manager name. - **Scheme Code** (string) - The NPS scheme code. - **Scheme Name** (string) - The name of the NPS scheme. - **NAV** (string) - The Net Asset Value of the fund. - **Last Updated** (string) - The date when the NAV was last updated. - **metadata** (object) - Contains information about the data. - **currency** (string) - The currency of the NAV values (e.g., INR). - **dataType** (string) - The type of data returned (e.g., NAV). - **count** (integer) - The total number of funds listed. - **lastUpdated** (string) - The date when the entire dataset was last updated. #### Response Example ```json { "data": [ { "PFM Code": "PFM001", "PFM Name": "SBI PENSION FUNDS PRIVATE LIMITED", "Scheme Code": "SM001001", "Scheme Name": "SBI PENSION FUND SCHEME - CENTRAL GOVT", "NAV": "46.7686", "Last Updated": "01-10-2024" } ], "metadata": { "currency": "INR", "dataType": "NAV", "count": 151, "lastUpdated": "01-10-2024" } } ``` ``` -------------------------------- ### Get Historical NPS NAV Data Source: https://github.com/rishikeshsreehari/npsnav/blob/main/src/content/nps-nav-excel.html This endpoint provides historical Net Asset Value (NAV) data for a specified NPS scheme. It's useful for analyzing performance trends over time and can be integrated into Excel using Power Query. ```APIDOC ## GET /api/historical/SchemeCode ### Description Retrieves a historical series of Net Asset Values (NAV) for a specified NPS scheme. ### Method GET ### Endpoint `/api/historical/SchemeCode` ### Parameters #### Path Parameters - **SchemeCode** (string) - Required - The unique identifier for the NPS scheme. ### Request Example (Power Query) ``` let SchemeCode = "SM010001", // Change this to the scheme code you want Source = Json.Document(Web.Contents("https://npsnav.in/api/historical/" & SchemeCode)), data = Source[data], #"Converted to Table" = Table.FromList(data, Splitter.SplitByNothing(), null, null, ExtraValues.Error), #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"date", "nav"}, {"date", "nav"}) in in #"Expanded Column1" ``` ### Response #### Success Response (200) - **data** (array) - An array of historical NAV records. - **date** (string) - The date of the NAV record (YYYY-MM-DD). - **nav** (number) - The Net Asset Value for that date. #### Response Example ```json { "data": [ { "date": "2023-10-27", "nav": 185.50 }, { "date": "2023-10-26", "nav": 185.30 } ] } ``` ``` -------------------------------- ### Get Individual NPS Fund NAV - Microsoft Excel Source: https://github.com/rishikeshsreehari/npsnav/blob/main/src/content/nps-api.html Retrieves the raw Net Asset Value (NAV) for a specific NPS fund using its scheme code. This function is designed for direct use in Microsoft Excel with the WEBSERVICE function, returning plain text NAV values. Ensure you have the correct scheme code for the desired fund. ```excel =WEBSERVICE("https://npsnav.in/api/SM001001") ``` -------------------------------- ### JavaScript: Initialize NAV and Returns Data Source: https://github.com/rishikeshsreehari/npsnav/blob/main/src/templates/funds.html Initializes JavaScript variables with NAV, Nifty, and returns data. This data is expected to be pre-processed and converted to JSON format before being assigned to these variables. ```javascript const navData = {{ nav_data | tojson }}; const niftyData = {{ nifty_data | tojson }}; const returns = {{ returns | tojson }}; ``` -------------------------------- ### Get Latest NPS NAV Source: https://github.com/rishikeshsreehari/npsnav/blob/main/src/content/nps-nav-sheets.html Fetch the latest Net Asset Value (NAV) for a specific NPS scheme. This endpoint is designed to be used directly within Google Sheets using the `IMPORTDATA` function. ```APIDOC ## GET /api/SchemeCode ### Description Retrieves the latest Net Asset Value (NAV) for a given NPS scheme code. This endpoint is ideal for real-time tracking in applications like Google Sheets. ### Method GET ### Endpoint `/api/SchemeCode` ### Parameters #### Path Parameters - **SchemeCode** (string) - Required - The unique identifier for the NPS scheme (e.g., "SM001001"). ### Request Example ``` =IMPORTDATA("https://npsnav.in/api/SM001001") ``` ### Response #### Success Response (200) - **NAV** (number) - The latest Net Asset Value of the specified NPS scheme. #### Response Example ```json { "NAV": 25.75 } ``` ``` -------------------------------- ### Copy Cryptocurrency Address to Clipboard (JavaScript) Source: https://github.com/rishikeshsreehari/npsnav/blob/main/src/templates/footer.html This JavaScript code snippet enables users to copy cryptocurrency addresses to their clipboard by clicking on the element containing the address. It provides visual feedback to the user upon successful copying. This functionality is intended for user convenience on the website. ```javascript document.onclick=e=>{ const c=e.target.closest?.('.crypto-line'); if(c){ const code=c.querySelector('code'); const addr=code.dataset.orig||(code.dataset.orig=code.textContent); navigator.clipboard.writeText(addr); code.style.backgroundColor='#404040'; code.style.color='white'; code.textContent='Copied!'; setTimeout(()=>{ code.style.backgroundColor=''; code.style.color=''; code.textContent=addr; },800); } }; ``` -------------------------------- ### Initialize Swagger UI for NPSNAV API Source: https://github.com/rishikeshsreehari/npsnav/blob/main/src/content/api.html This JavaScript code initializes the Swagger UI component to interact with the NPSNAV API. It fetches the API specification from 'https://npsnav.in/openapi.json' and configures various UI options for an enhanced developer experience. ```javascript window.onload = () => { SwaggerUIBundle({ url: "https://npsnav.in/openapi.json", dom_id: "#swagger-ui", deepLinking: true, docExpansion: 'list', defaultModelsExpandDepth: -1, presets: [ SwaggerUIBundle.presets.apis, SwaggerUIStandalonePreset ], layout: "BaseLayout" }); }; ``` -------------------------------- ### Analytics Integration (HTML/Jinja) Source: https://github.com/rishikeshsreehari/npsnav/blob/main/src/templates/footer.html This snippet represents the inclusion of analytics tracking for the website. It assumes a templating engine like Jinja is used, where {% include 'analytics.html' %} would insert the actual analytics code. This is crucial for understanding user traffic and behavior. ```html {% include 'analytics.html' %} ``` -------------------------------- ### Render Changelog using Jinja2 Template Source: https://github.com/rishikeshsreehari/npsnav/blob/main/src/templates/changelog.html This Jinja2 template iterates through a CHANGELOG object to display version information, dates, and individual changes. It assumes a data structure where CHANGELOG is a list of entries, each containing a version, date, and a list of changes. This is used for dynamically generating the changelog on the website. ```jinja2 {% extends "base.html" %} {% block title %} NPSNAV.in - Latest Updates & Fixes {% endblock %} {% block keywords %} changelog, updates, website changes, bug fixes, improvements, release notes, version history {% endblock %} {% block description %} Stay up to date with the latest improvements, bug fixes, and feature updates on this website. All changes are listed in chronological order. {% endblock %} {% block canonical %}https://npsnav.in/changelog{% endblock %} {% block content %} Changelog ========= A curated, chronologically ordered list of notable changes and fixes done to this website. {% for entry in CHANGELOG %} {{ entry.version }} ------------------- {{ entry.date }} {% for change in entry.changes %}* {{ change }} {% endfor %} {% endfor %} {% endblock %} ``` -------------------------------- ### Fetch Detailed NPS Fund Information (JSON) Source: https://context7.com/rishikeshsreehari/npsnav/llms.txt Returns comprehensive details for a specific NPS scheme, including the latest NAV and historical return percentages across various timeframes (1 day to 5 years). The response is in JSON format. ```bash curl https://npsnav.in/api/detailed/SM001001 ``` ```json { "Last Updated": "01-10-2024", "PFM Code": "PFM001", "PFM Name": "SBI PENSION FUNDS PRIVATE LIMITED", "Scheme Code": "SM001001", "Scheme Name": "SBI PENSION FUND SCHEME - CENTRAL GOVT", "NAV": "46.7686", "1D": "0.10", "7D": "0.13", "1M": "1.34", "3M": "3.51", "6M": "6.73", "1Y": "13.98", "3Y": "8.16", "5Y": "9.23" } ``` ```python import requests response = requests.get("https://npsnav.in/api/detailed/SM001001") data = response.json() print(f"Scheme: {data['Scheme Name']}") print(f"Current NAV: ₹{data['NAV']}") print(f"1-Year Return: {data['1Y']}%") print(f"3-Year Return: {data['3Y']}%") ``` -------------------------------- ### All Schemes API Source: https://context7.com/rishikeshsreehari/npsnav/llms.txt Retrieves a comprehensive list of all available NPS scheme codes and their corresponding names. ```APIDOC ## GET /api/schemes ### Description Returns the complete list of available NPS scheme codes and names for reference. ### Method GET ### Endpoint `/api/schemes` ### Parameters No parameters are required for this endpoint. ### Request Example ```bash curl https://npsnav.in/api/schemes ``` ### Response #### Success Response (200) - **data** (array) - An array where each element is a sub-array containing the scheme code and scheme name. - **[schemeCode, schemeName]** (array) - A two-element array with the scheme code (string) and scheme name (string). - **metadata** (object) - Contains additional information about the list of schemes. - **count** (integer) - The total number of schemes available. - **lastUpdated** (string) - The date when the scheme list was last updated (format: DD-MM-YYYY). #### Response Example ```json { "data": [ ["SM001001", "SBI PENSION FUND SCHEME - CENTRAL GOVT"], ["SM001002", "SBI PENSION FUND SCHEME - STATE GOVT"] ], "metadata": { "count": 151, "lastUpdated": "22-12-2025" } } ``` ``` -------------------------------- ### All Funds Latest API (Minimal JSON) Source: https://context7.com/rishikeshsreehari/npsnav/llms.txt Provides a lightweight JSON response containing only scheme codes and NAV values for all available NPS funds. Ideal for bandwidth-constrained applications or when only essential data is needed. ```APIDOC ## GET /api/latest-min ### Description Provides a minimal JSON response containing only scheme codes and NAV values for all available NPS funds. ### Method GET ### Endpoint `/api/latest-min` ### Parameters None ### Request Example `curl https://npsnav.in/api/latest-min` ### Response #### Success Response (200) - **data** (array) - An array of arrays, where each inner array contains the scheme code and its corresponding NAV. - **[0]** (string) - The NPS scheme code. - **[1]** (number) - The current Net Asset Value. - **metadata** (object) - Contains overall information about the dataset. - **currency** (string) - The currency of the NAV values (e.g., "INR"). - **dataType** (string) - The type of data provided (e.g., "NAV"). - **count** (integer) - The total number of funds included. - **lastUpdated** (string) - The date the entire dataset was last updated. #### Response Example ```json { "data": [ ["SM001001", 46.7686], ["SM001002", 52.3421], ["SM008001", 93.4021] ], "metadata": { "currency": "INR", "dataType": "NAV", "count": 151, "lastUpdated": "01-10-2024" } } ``` ### Usage Example (Python Pandas) ```python import pandas as pd import requests response = requests.get("https://npsnav.in/api/latest-min") result = response.json() df = pd.DataFrame(result['data'], columns=['Scheme Code', 'NAV']) df['NAV'] = pd.to_numeric(df['NAV']) print(f"Average NAV: ₹{df['NAV'].mean():.2f}") print(f"Highest NAV: ₹{df['NAV'].max():.2f}") print(f"\nTop 5 funds by NAV:") print(df.nlargest(5, 'NAV')) ``` ``` -------------------------------- ### Fetch All NPS Schemes List (Bash) Source: https://context7.com/rishikeshsreehari/npsnav/llms.txt Retrieves a list of all available NPS scheme codes and their corresponding names using a cURL command. This endpoint is useful for obtaining a reference list of schemes. ```bash curl https://npsnav.in/api/schemes ``` -------------------------------- ### Get Individual NPS Fund NAV - Google Sheets Source: https://github.com/rishikeshsreehari/npsnav/blob/main/src/content/nps-api.html Retrieves the raw Net Asset Value (NAV) for a specific NPS fund using its scheme code. This function is designed for direct use in Google Sheets with the IMPORTDATA function, returning plain text NAV values. Ensure you have the correct scheme code for the desired fund. ```google-sheets =IMPORTDATA("https://npsnav.in/api/SM001001") ``` -------------------------------- ### Fetch All NPS Funds Latest NAV (Minimal JSON) Source: https://context7.com/rishikeshsreehari/npsnav/llms.txt Provides a lightweight JSON response containing only scheme codes and their corresponding NAV values. This endpoint is ideal for bandwidth-constrained applications or when only NAV data is required. ```bash curl https://npsnav.in/api/latest-min ``` ```json { "data": [ ["SM001001", 46.7686], ["SM001002", 52.3421], ["SM008001", 93.4021] ], "metadata": { "currency": "INR", "dataType": "NAV", "count": 151, "lastUpdated": "01-10-2024" } } ``` ```python import pandas as pd import requests response = requests.get("https://npsnav.in/api/latest-min") result = response.json() df = pd.DataFrame(result['data'], columns=['Scheme Code', 'NAV']) df['NAV'] = pd.to_numeric(df['NAV']) print(f"Average NAV: ₹{df['NAV'].mean():.2f}") print(f"Highest NAV: ₹{df['NAV'].max():.2f}") print(f"\nTop 5 funds by NAV:") print(df.nlargest(5, 'NAV')) ``` -------------------------------- ### All Funds Latest API (Detailed JSON) Source: https://context7.com/rishikeshsreehari/npsnav/llms.txt Fetches the latest NAV and metadata for all available NPS funds in a single, detailed JSON response. Useful for comprehensive dashboards and analyses. ```APIDOC ## GET /api/latest ### Description Fetches the latest NAV and metadata for all available NPS funds. ### Method GET ### Endpoint `/api/latest` ### Parameters None ### Request Example `curl https://npsnav.in/api/latest` ### Response #### Success Response (200) - **data** (array) - An array of fund objects, each containing PFM details, scheme details, NAV, and last updated date. - **PFM Code** (string) - The Pension Fund Manager code. - **PFM Name** (string) - The Pension Fund Manager name. - **Scheme Code** (string) - The NPS scheme code. - **Scheme Name** (string) - The NPS scheme name. - **NAV** (string) - The current Net Asset Value. - **Last Updated** (string) - The date the data was last updated. - **metadata** (object) - Contains overall information about the dataset. - **currency** (string) - The currency of the NAV values (e.g., "INR"). - **dataType** (string) - The type of data provided (e.g., "NAV"). - **count** (integer) - The total number of funds included. - **lastUpdated** (string) - The date the entire dataset was last updated. #### Response Example ```json { "data": [ { "PFM Code": "PFM001", "PFM Name": "SBI PENSION FUNDS PRIVATE LIMITED", "Scheme Code": "SM001001", "Scheme Name": "SBI PENSION FUND SCHEME - CENTRAL GOVT", "NAV": "46.7686", "Last Updated": "01-10-2024" }, { "PFM Code": "PFM001", "PFM Name": "SBI PENSION FUNDS PRIVATE LIMITED", "Scheme Code": "SM001002", "Scheme Name": "SBI PENSION FUND SCHEME - STATE GOVT", "NAV": "52.3421", "Last Updated": "01-10-2024" } ], "metadata": { "currency": "INR", "dataType": "NAV", "count": 151, "lastUpdated": "01-10-2024" } } ``` ### Usage Example (JavaScript) ```javascript fetch('https://npsnav.in/api/latest') .then(response => response.json()) .then(result => { console.log(`Total funds: ${result.metadata.count}`); console.log(`Last updated: ${result.metadata.lastUpdated}`); result.data.forEach(fund => { if (parseFloat(fund.NAV) > 50) { console.log(`${fund['Scheme Code']}: ₹${fund.NAV}`); } }); }) .catch(error => console.error('Error:', error)); ``` ``` -------------------------------- ### Visualize Historical NAV with Python Source: https://context7.com/rishikeshsreehari/npsnav/llms.txt Fetches historical daily NAV data for an NPS scheme using Python's requests library, processes it with pandas, and visualizes the NAV trend over time using matplotlib. The chart is saved as a PNG image. ```python import requests import pandas as pd import matplotlib.pyplot as plt from datetime import datetime response = requests.get("https://npsnav.in/api/historical/SM001001") result = response.json() df = pd.DataFrame(result['data']) df['date'] = pd.to_datetime(df['date'], format='%d-%m-%Y') df = df.sort_values('date') plt.figure(figsize=(12, 6)) plt.plot(df['date'], df['nav'], linewidth=2) plt.title('SBI Pension Fund - Historical NAV') plt.xlabel('Date') plt.ylabel('NAV (₹)') plt.grid(True, alpha=0.3) plt.tight_layout() plt.savefig('nav_history.png') print("Chart saved as nav_history.png") ``` -------------------------------- ### Search NPS Schemes with Node.js Source: https://context7.com/rishikeshsreehari/npsnav/llms.txt Fetches the list of all NPS schemes using Node.js and the axios library, then filters the list to find schemes matching a given keyword in their name. It logs the matching schemes to the console. ```javascript const axios = require('axios'); async function searchScheme(keyword) { try { const response = await axios.get('https://npsnav.in/api/schemes'); const schemes = response.data.data; const matches = schemes.filter(([code, name]) => name.toLowerCase().includes(keyword.toLowerCase()) ); console.log(`Found ${matches.length} schemes matching "${keyword}":`); matches.forEach(([code, name]) => { console.log(`${code}: ${name}`); }); return matches; } catch (error) { console.error('Error fetching schemes:', error.message); } } searchScheme('EQUITY'); ``` -------------------------------- ### Fetch Historical NAV Data (Bash) Source: https://context7.com/rishikeshsreehari/npsnav/llms.txt Retrieves complete historical daily Net Asset Value (NAV) data for a specified NPS scheme using a simple cURL command. This is useful for quick data retrieval or scripting. ```bash curl https://npsnav.in/api/historical/SM001001 ``` -------------------------------- ### Fetch Detailed Fund Data with Returns (JSON) Source: https://github.com/rishikeshsreehari/npsnav/blob/main/src/content/nps-api.html Retrieves detailed performance metrics for a specific fund, including NAV and returns from 1-day to 5-year periods. This endpoint requires a Scheme Code as a path parameter. The response is a JSON object containing various performance indicators. ```json { "Last Updated": "01-10-2024", "PFM Code": "PFM001", "PFM Name": "SBI PENSION FUNDS PRIVATE LIMITED", "Scheme Code": "SM001001", "Scheme Name": "SBI PENSION FUND SCHEME - CENTRAL GOVT", "NAV": "46.7686", "1D": "0.10", "7D": "0.13", "1M": "1.34", "3M": "3.51", "6M": "6.73", "1Y": "13.98", "3Y": "8.16", "5Y": "9.23" } ``` -------------------------------- ### Detailed Fund API (JSON) Source: https://context7.com/rishikeshsreehari/npsnav/llms.txt Retrieves comprehensive fund information for a specific NPS scheme, including the latest NAV and return percentages across various time periods (1 day to 5 years). ```APIDOC ## GET /api/detailed/{schemeCode} ### Description Returns detailed fund information including NAV and performance percentages for a specific NPS scheme. ### Method GET ### Endpoint `/api/detailed/{schemeCode}` ### Parameters #### Path Parameters - **schemeCode** (string) - Required - The unique code of the NPS scheme (e.g., `SM001001`). ### Request Example `curl https://npsnav.in/api/detailed/SM001001` ### Response #### Success Response (200) - **Last Updated** (string) - The date the data was last updated. - **PFM Code** (string) - The Pension Fund Manager code. - **PFM Name** (string) - The Pension Fund Manager name. - **Scheme Code** (string) - The NPS scheme code. - **Scheme Name** (string) - The NPS scheme name. - **NAV** (string) - The current Net Asset Value. - **1D** (string) - 1-day return percentage. - **7D** (string) - 7-day return percentage. - **1M** (string) - 1-month return percentage. - **3M** (string) - 3-month return percentage. - **6M** (string) - 6-month return percentage. - **1Y** (string) - 1-year return percentage. - **3Y** (string) - 3-year return percentage. - **5Y** (string) - 5-year return percentage. #### Response Example ```json { "Last Updated": "01-10-2024", "PFM Code": "PFM001", "PFM Name": "SBI PENSION FUNDS PRIVATE LIMITED", "Scheme Code": "SM001001", "Scheme Name": "SBI PENSION FUND SCHEME - CENTRAL GOVT", "NAV": "46.7686", "1D": "0.10", "7D": "0.13", "1M": "1.34", "3M": "3.51", "6M": "6.73", "1Y": "13.98", "3Y": "8.16", "5Y": "9.23" } ``` ### Usage Example (Python) ```python import requests response = requests.get("https://npsnav.in/api/detailed/SM001001") data = response.json() print(f"Scheme: {data['Scheme Name']}") print(f"Current NAV: ₹{data['NAV']}") print(f"1-Year Return: {data['1Y']}%") print(f"3-Year Return: {data['3Y']}%") ``` ``` -------------------------------- ### NPSNAV.in API: Fetch Latest NAV for All Funds (Minimal JSON) Source: https://github.com/rishikeshsreehari/npsnav/blob/main/README.md Provides a lightweight JSON output containing only the scheme code and latest NAV for all NPS funds. This is ideal for scenarios where only essential data is needed, optimizing bandwidth. ```json { "data": [ ["SM001001", 46.7686], ["SM008001", 93.4021] ], "metadata": { "currency": "INR", "dataType": "NAV", "count": 151, "lastUpdated": "01-10-2024" } } ``` -------------------------------- ### Fetch Latest Minimal NAV Data (JSON) Source: https://github.com/rishikeshsreehari/npsnav/blob/main/src/content/nps-api.html Retrieves a lighter, faster version of NAV data containing only Scheme Code and NAV values. This endpoint is useful for quick lookups where minimal data is required. The response is a JSON object with 'data' and 'metadata' fields. ```json { "data": [ ["SM001001", 46.7686], ["SM008001", 93.4021] ], "metadata": { "count": 151, "lastUpdated": "01-10-2024" } } ``` -------------------------------- ### Detailed API (JSON) Source: https://github.com/rishikeshsreehari/npsnav/blob/main/README.md Returns comprehensive fund details including the latest NAV, various performance metrics (1D, 7D, 1M, etc.), and PFM information for a specific scheme code. The response is in JSON format. ```APIDOC ## GET /api/detailed/{scheme_code} ### Description Fetches detailed information for a specific NPS fund, including its latest NAV, historical returns across different periods, and PFM details. The response is returned in JSON format. ### Method GET ### Endpoint `/api/detailed/{scheme_code}` ### Parameters #### Path Parameters - **scheme_code** (string) - Required - The unique identifier for the NPS fund scheme. ### Request Example ``` https://npsnav.in/api/detailed/SM001001 ``` ### Response #### Success Response (200) - **Last Updated** (string) - The date when the data was last updated. - **PFM Code** (string) - The code of the Pension Fund Manager (PFM). - **PFM Name** (string) - The name of the Pension Fund Manager (PFM). - **Scheme Code** (string) - The unique identifier for the NPS fund scheme. - **Scheme Name** (string) - The name of the NPS fund scheme. - **NAV** (string) - The latest Net Asset Value of the fund. - **1D**, **7D**, **1M**, **3M**, **6M**, **1Y**, **3Y**, **5Y** (string) - Performance returns for the respective periods. #### Response Example ```json { "Last Updated": "01-10-2024", "PFM Code": "PFM001", "PFM Name": "SBI PENSION FUNDS PRIVATE LIMITED", "Scheme Code": "SM001001", "Scheme Name": "SBI PENSION FUND SCHEME - CENTRAL GOVT", "NAV": "46.7686", "1D": "0.10", "7D": "0.13", "1M": "1.34", "3M": "3.51", "6M": "6.73", "1Y": "13.98", "3Y": "8.16", "5Y": "9.23" } ``` ``` -------------------------------- ### Schemes API Source: https://github.com/rishikeshsreehari/npsnav/blob/main/src/content/nps-api.html Fetch the list of all available NPS scheme codes along with their scheme names. This endpoint is useful for discovering valid `scheme_code` values before using other APIs. ```APIDOC ## Schemes API ### Description Fetch the list of all available NPS scheme codes along with their scheme names. This endpoint is useful for discovering valid `scheme_code` values before using other APIs. ### Method GET ### Endpoint https://npsnav.in/api/schemes ### Parameters #### Query Parameters N/A #### Request Body N/A ### Response #### Success Response (200) - **data** (array of arrays) - Each inner array contains a scheme code and scheme name. - **metadata** (object) - Contains count and last updated date. - **count** (integer) - The total number of schemes. - **lastUpdated** (string) - The date when the data was last updated. #### Response Example ```json { "data": [ ["SM001001", "SBI PENSION FUND SCHEME - CENTRAL GOVT"], ["SM001002", "SBI PENSION FUND SCHEME - STATE GOVT"], ["SM008001", "HDFC PENSION FUND SCHEME E - TIER I"] ], "metadata": { "count": 151, "lastUpdated": "22-12-2025" } } ``` ``` -------------------------------- ### Simple API for NAV Source: https://github.com/rishikeshsreehari/npsnav/blob/main/src/content/nps-api.html Fetch the raw NAV value for any individual NPS fund using its unique scheme code. This returns plain text, perfect for spreadsheet formulas. ```APIDOC ## Simple API for NAV ### Description Fetch the raw NAV value for any individual NPS fund using its unique scheme code. This returns plain text, perfect for spreadsheet formulas. ### Method GET ### Endpoint https://npsnav.in/api/{scheme_code} ### Parameters #### Path Parameters - **scheme_code** (string) - Required - The unique code for the NPS scheme. #### Query Parameters N/A #### Request Body N/A ### Request Example * **SBI Pension Fund Scheme** (SM001001): `https://npsnav.in/api/SM001001` ### Integration Guides **Google Sheets (using `IMPORTDATA`):** ``` =IMPORTDATA("https://npsnav.in/api/SM001001") ``` **Microsoft Excel (using `WEBSERVICE`):** ``` =WEBSERVICE("https://npsnav.in/api/SM001001") ``` ### Response #### Success Response (200) - **NAV Value** (string) - The Net Asset Value of the fund. #### Response Example ``` 46.7686 ``` ``` -------------------------------- ### Fetch All NPS Funds Latest NAV (Detailed JSON) Source: https://context7.com/rishikeshsreehari/npsnav/llms.txt Retrieves the latest NAV and associated metadata for all available NPS funds in a single, detailed JSON response. This endpoint includes PFM and scheme information along with the NAV and last updated date. ```bash curl https://npsnav.in/api/latest ``` ```json { "data": [ { "PFM Code": "PFM001", "PFM Name": "SBI PENSION FUNDS PRIVATE LIMITED", "Scheme Code": "SM001001", "Scheme Name": "SBI PENSION FUND SCHEME - CENTRAL GOVT", "NAV": "46.7686", "Last Updated": "01-10-2024" }, { "PFM Code": "PFM001", "PFM Name": "SBI PENSION FUNDS PRIVATE LIMITED", "Scheme Code": "SM001002", "Scheme Name": "SBI PENSION FUND SCHEME - STATE GOVT", "NAV": "52.3421", "Last Updated": "01-10-2024" } ], "metadata": { "currency": "INR", "dataType": "NAV", "count": 151, "lastUpdated": "01-10-2024" } } ``` ```javascript fetch('https://npsnav.in/api/latest') .then(response => response.json()) .then(result => { console.log(`Total funds: ${result.metadata.count}`); console.log(`Last updated: ${result.metadata.lastUpdated}`); result.data.forEach(fund => { if (parseFloat(fund.NAV) > 50) { console.log(`${fund['Scheme Code']}: ₹${fund.NAV}`); } }); }) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### Latest API (All Funds, Detailed JSON) Source: https://github.com/rishikeshsreehari/npsnav/blob/main/README.md Retrieves the latest NAV and metadata for all NPS funds in a single API call. The response is a JSON object containing an array of fund data and metadata. ```APIDOC ## GET /api/latest ### Description Fetches the latest Net Asset Value (NAV) and associated metadata for all NPS funds in a single request. The response is a JSON object containing a list of funds and metadata about the data. ### Method GET ### Endpoint `/api/latest` ### Parameters None ### Request Example ``` https://npsnav.in/api/latest ``` ### Response #### Success Response (200) - **data** (array) - An array of objects, where each object contains details for an NPS fund. - **PFM Code** (string) - The code of the Pension Fund Manager (PFM). - **PFM Name** (string) - The name of the Pension Fund Manager (PFM). - **Scheme Code** (string) - The unique identifier for the NPS fund scheme. - **Scheme Name** (string) - The name of the NPS fund scheme. - **NAV** (string) - The latest Net Asset Value of the fund. - **Last Updated** (string) - The date when the data was last updated. - **metadata** (object) - Contains metadata about the data set. - **currency** (string) - The currency of the NAV values. - **dataType** (string) - Indicates the type of data provided (e.g., "NAV"). - **count** (integer) - The total number of funds included in the response. - **lastUpdated** (string) - The timestamp of the last data update. #### Response Example ```json { "data": [ { "PFM Code": "PFM001", "PFM Name": "SBI PENSION FUNDS PRIVATE LIMITED", "Scheme Code": "SM001001", "Scheme Name": "SBI PENSION FUND SCHEME - CENTRAL GOVT", "NAV": "46.7686", "Last Updated": "01-10-2024" } ], "metadata": { "currency": "INR", "dataType": "NAV", "count": 151, "lastUpdated": "01-10-2024" } } ``` ``` -------------------------------- ### Fetch Latest NPS Fund NAV (Plain Text) Source: https://context7.com/rishikeshsreehari/npsnav/llms.txt Retrieves the current Net Asset Value (NAV) for a specific NPS scheme as plain text. This endpoint is optimized for direct import into spreadsheets like Google Sheets and Excel. ```bash curl https://npsnav.in/api/SM001001 ``` ```text 49.7707 ``` ```google-sheets =IMPORTDATA("https://npsnav.in/api/SM001001") ``` ```excel =WEBSERVICE("https://npsnav.in/api/SM001001") ``` -------------------------------- ### Latest NAV API (Plain Text) Source: https://context7.com/rishikeshsreehari/npsnav/llms.txt Retrieves the current Net Asset Value (NAV) for a specific NPS scheme as plain text. This endpoint is optimized for direct import into spreadsheet applications like Google Sheets and Excel. ```APIDOC ## GET /api/{schemeCode} ### Description Returns the current NAV value as plain text for a specific NPS scheme. ### Method GET ### Endpoint `/api/{schemeCode}` ### Parameters #### Path Parameters - **schemeCode** (string) - Required - The unique code of the NPS scheme (e.g., `SM001001`). ### Request Example `curl https://npsnav.in/api/SM001001` ### Response #### Success Response (200) - **NAV** (string) - The latest Net Asset Value for the specified scheme. #### Response Example ``` 49.7707 ``` ### Usage Examples **Google Sheets:** ``` =IMPORTDATA("https://npsnav.in/api/SM001001") ``` **Excel:** ``` =WEBSERVICE("https://npsnav.in/api/SM001001") ``` ```