Access Pakistani Rupee (PKR) Exchange Rates in JSON Format: API Integration Tips

Metals-API 6 min read
Access Pakistani Rupee (PKR) Exchange Rates in JSON Format: API Integration Tips

Access Pakistani Rupee (PKR) Exchange Rates in JSON Format: API Integration Tips

In today's fast-paced financial landscape, accessing real-time exchange rates is crucial for businesses and developers alike. The Metals-API provides a powerful solution for retrieving exchange rates, including the Pakistani Rupee (PKR), in a convenient JSON format. This blog post will delve into the capabilities of the Metals-API, focusing on its innovative features, integration tips, and practical applications for developers looking to harness the power of real-time metals data.

Metals-API Information

About Nickel (NI)

Nickel, a key industrial metal, plays a significant role in various sectors, including electronics, automotive, and construction. As the world embraces digital transformation, the metal markets are also evolving. Technological innovations and advancements in data analytics are reshaping how we understand and interact with metal prices. The integration of smart technology into these markets is paving the way for future trends that promise to enhance efficiency and transparency.

With the Metals-API, developers can access a wealth of data about nickel and other metals, enabling them to build next-generation applications that leverage real-time insights. The API empowers users to analyze market trends, track price fluctuations, and make informed decisions based on accurate data.

API Description

The Metals-API is designed to provide developers with seamless access to real-time and historical metals data. This API is not just a tool; it represents a transformative potential for industries relying on accurate metal pricing. By integrating the Metals-API into applications, developers can create solutions that respond to market changes in real-time, enhancing user experience and operational efficiency.

For more detailed information about the API's capabilities, visit the Metals-API Website or check out the Metals-API Documentation.

Key Features and Endpoints

The Metals-API offers a variety of endpoints that cater to different needs, allowing developers to retrieve essential data efficiently. Here are some of the key features:

  • Latest Rates Endpoint: This endpoint provides real-time exchange rate data, updated every 60 minutes or more frequently, depending on your subscription plan. For example, you can retrieve the latest rates for PKR against various metals.
  • {
    "success": true,
    "timestamp": 1782889667,
    "base": "USD",
    "date": "2026-07-01",
    "rates": {
    "XAU": 0.000482,
    "XAG": 0.03815,
    "XNI": 0.142857
    },
    "unit": "per troy ounce"
    }
  • Historical Rates Endpoint: Access historical rates dating back to 2019 by appending a specific date to your query. This feature is invaluable for analyzing trends over time.
  • {
    "success": true,
    "timestamp": 1782803267,
    "base": "USD",
    "date": "2026-06-30",
    "rates": {
    "XAU": 0.000485,
    "XAG": 0.03825
    },
    "unit": "per troy ounce"
    }
  • Bid And Ask Endpoint: Retrieve real-time bid and ask prices for metals, which is crucial for traders looking to make informed decisions.
  • {
    "success": true,
    "timestamp": 1782889667,
    "base": "USD",
    "date": "2026-07-01",
    "rates": {
    "XAU": {
    "bid": 0.000481,
    "ask": 0.000483,
    "spread": 2.0e-6
    }
    },
    "unit": "per troy ounce"
    }
  • Convert Endpoint: This endpoint allows you to convert any amount from one currency to another, making it easy to work with different metal prices.
  • {
    "success": true,
    "query": {
    "from": "USD",
    "to": "XAU",
    "amount": 1000
    },
    "info": {
    "timestamp": 1782889667,
    "rate": 0.000482
    },
    "result": 0.482,
    "unit": "troy ounces"
    }
  • Time-Series Endpoint: Query the API for daily historical rates between two dates of your choice, allowing for in-depth analysis of price movements.
  • {
    "success": true,
    "timeseries": true,
    "start_date": "2026-06-24",
    "end_date": "2026-07-01",
    "base": "USD",
    "rates": {
    "2026-06-24": {
    "XAU": 0.000485
    },
    "2026-07-01": {
    "XAU": 0.000482
    }
    },
    "unit": "per troy ounce"
    }
  • Fluctuation Endpoint: Track how currencies fluctuate on a day-to-day basis, providing insights into market volatility.
  • {
    "success": true,
    "fluctuation": true,
    "start_date": "2026-06-24",
    "end_date": "2026-07-01",
    "base": "USD",
    "rates": {
    "XAU": {
    "start_rate": 0.000485,
    "end_rate": 0.000482,
    "change": -3.0e-6,
    "change_pct": -0.62
    }
    },
    "unit": "per troy ounce"
    }
  • Open/High/Low/Close (OHLC) Price Endpoint: Get comprehensive OHLC data for a specific time period, which is essential for traders analyzing price trends.
  • {
    "success": true,
    "timestamp": 1782889667,
    "base": "USD",
    "date": "2026-07-01",
    "rates": {
    "XAU": {
    "open": 0.000485,
    "high": 0.000487,
    "low": 0.000481,
    "close": 0.000482
    }
    },
    "unit": "per troy ounce"
    }
  • Lowest/Highest Price Endpoint: Query the API to get the lowest and highest price for a specific date, which can help in identifying market trends.
  • {
    "success": true,
    "timestamp": 1782889667,
    "base": "USD",
    "date": "2026-07-01",
    "rates": {
    "XAU": {
    "lowest": 0.000481,
    "highest": 0.000487
    }
    },
    "unit": "per troy ounce"
    }
  • Historical LME Endpoint: Access historical rates for LME symbols dating back to 2008, providing a long-term view of metal prices.
  • API Key: Your unique API key is essential for accessing the API and must be included in your requests.
  • API Response: The Metals-API delivers exchange rates relative to USD by default, ensuring consistency in your data.
  • Available Endpoints: The API offers 14 endpoints, each providing distinct functionalities tailored to various use cases.
  • Supported Symbols Endpoint: Access a constantly updated list of all available currencies and metals, which is crucial for ensuring your application uses the correct symbols.

For a complete list of all supported symbols and their specifications, refer to the Metals-API Supported Symbols.

API Endpoint Examples and Responses

Understanding the API responses is crucial for effective integration. Below are examples of various endpoint responses, showcasing the data you can expect:

Latest Rates Endpoint

Get real-time exchange rates for all available metals:

{
"success": true,
"timestamp": 1782889667,
"base": "USD",
"date": "2026-07-01",
"rates": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912,
"XPD": 0.000744,
"XCU": 0.294118,
"XAL": 0.434783,
"XNI": 0.142857,
"XZN": 0.344828
},
"unit": "per troy ounce"
}

Historical Rates Endpoint

Access historical exchange rates for any date since 1999:

{
"success": true,
"timestamp": 1782803267,
"base": "USD",
"date": "2026-06-30",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}

Time-series Endpoint

Get exchange rates for a specific time period:

{
"success": true,
"timeseries": true,
"start_date": "2026-06-24",
"end_date": "2026-07-01",
"base": "USD",
"rates": {
"2026-06-24": {
"XAU": 0.000485,
"XAG": 0.03825
},
"2026-07-01": {
"XAU": 0.000482,
"XAG": 0.03815
}
},
"unit": "per troy ounce"
}

Convert Endpoint

Convert any amount from one metal to another or to/from USD:

{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1782889667,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}

Fluctuation Endpoint

Track rate fluctuations between two dates:

{
"success": true,
"fluctuation": true,
"start_date": "2026-06-24",
"end_date": "2026-07-01",
"base": "USD",
"rates": {
"XAU": {
"start_rate": 0.000485,
"end_rate": 0.000482,
"change": -3.0e-6,
"change_pct": -0.62
}
},
"unit": "per troy ounce"
}

OHLC (Open/High/Low/Close) Endpoint

Get OHLC data for a specific time period:

{
"success": true,
"timestamp": 1782889667,
"base": "USD",
"date": "2026-07-01",
"rates": {
"XAU": {
"open": 0.000485,
"high": 0.000487,
"low": 0.000481,
"close": 0.000482
}
},
"unit": "per troy ounce"
}

Bid/Ask Endpoint

Get current bid and ask prices for metals:

{
"success": true,
"timestamp": 1782889667,
"base": "USD",
"date": "2026-07-01",
"rates": {
"XAU": {
"bid": 0.000481,
"ask": 0.000483,
"spread": 2.0e-6
}
},
"unit": "per troy ounce"
}

Conclusion

Accessing the Pakistani Rupee (PKR) exchange rates in JSON format through the Metals-API opens up a world of possibilities for developers and businesses. With features like real-time data, historical rates, and various endpoints tailored for different needs, the Metals-API stands out as a robust solution for financial applications. By leveraging this API, developers can create applications that not only provide accurate pricing but also enhance user engagement through real-time insights.

For further exploration, refer to the Metals-API Documentation and ensure you are utilizing all available resources effectively. The ability to access a comprehensive range of metal symbols and their specifications is crucial for any developer working in this space. Don't hesitate to dive deeper into the Metals-API Supported Symbols to enhance your application's functionality.

In summary, the Metals-API is not just a tool for retrieving data; it is a gateway to understanding market dynamics and making informed decisions based on real-time data. Embrace the future of metal pricing with the Metals-API and unlock the potential of your applications.