Get API Key

To get the API key, please log in first.

📡 How to Use the API Key

To use the API, you need an API Key which works like a password and verifies your access to the service. This key allows you to access various features and data of the service, and all requests must be made using it.

📌 Why use X-API-Key?

X-API-Key is a standard way to send authentication keys supported by many APIs. This method:

🚀 How to Send the API Key in an HTTP Request

To send the API Key using X-API-Key, just place its value in the headers section:

📝 Request Code Sample:

fetch("https://www.world-api.ir/api/v1/countries", { 
  method: "GET", 
  headers: { 
    "X-API-Key": "your-api-key",  // 🔴 Replace your key here
    "Accept-Language" : "fa" // en , ar or fa
  } 
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error("Error:", error));

âš ī¸ Important Security Tips for Using an API Key