Location API Testing
No API keys found. Create one
{% endif %}Examples: Lilongwe, Blantyre, Mzuzu
cURL Command
curl -H "X-API-Key: YOUR_API_KEY" \ "https://developers.pezamw.com/api/locations/?location=Lilongwe&category=hospital"
Raw Response
—
No response yet.
Search Results
Select an API key and click "Search Locations"
Code Examples
import requests
api_key = "your_api_key_here"
url = "https://developers.pezamw.com/api/locations/"
headers = {"X-API-Key": api_key}
params = {
"location": "Lilongwe",
"category": "hospital",
"radius": 5000
}
response = requests.get(
url,
headers=headers,
params=params
)
data = response.json()
if data.get('success'):
for loc in data['locations']:
print(f"{loc['name']} - {loc['distance']}")
const axios = require('axios');
const apiKey = 'your_api_key_here';
const url = 'https://developers.pezamw.com/api/locations/';
axios.get(url, {
headers: { 'X-API-Key': apiKey },
params: {
location: 'Lilongwe',
category: 'hospital',
radius: 5000
}
})
.then(response => {
if (response.data.success) {
response.data.locations.forEach(loc => {
console.log(`${loc.name} - ${loc.distance}`);
});
}
})
.catch(error => {
console.error('Error:', error.response?.data);
});
curl -X GET \ -H "X-API-Key: your_api_key_here" \ "https://developers.pezamw.com/api/locations/?location=Lilongwe&category=hospital&radius=5000"
API Information
Endpoint
GET /api/locations/
Authentication
X-API-Key header required
Required Parameters
- location (city name)
- category (service type)
Optional
- radius (default: 5000m)
- limit (max results)