CharkhARZ API Documentation

A simple public API to fetch free exchange rates (in IRR) from tgju.org

Current Dollar Price (IRR)
Loading...

About This API

This API fetches data from tgju.org and provides it in a simple JSON format. Data is cached for 60 minutes.

Source Code: GitHub Repository

License: MIT

API Endpoints

GET /api/dollar

Returns the current USD to IRR exchange rate

Parameters

Parameter Type Description
pretty boolean When set to true, returns formatted JSON

Response Example

{
  "success": true,
  "price": "42,050",
  "currency": "IRR",
  "last_updated": "1402-05-15 14:30:45",
  "source": "tgju.org"
}

How to Use

JavaScript Fetch

fetch('https://charkharz.vercel.app/api/dollar')
  .then(response => response.json())
  .then(data => {
    if (data.success) {
      console.log('Current price:', data.price);
    }
  });

cURL

curl -X GET 'https://charkharz.vercel.app/api/dollar?pretty=true'

Python

import requests

response = requests.get('https://charkharz.vercel.app/api/dollar')
data = response.json()
print(data['price'])