Places API

GET /api/places

Access our comprehensive places database with a simple, secure API. Get started in minutes with authentication, rich data, and reliable endpoints.

Live & Active

API Endpoint

GET https://places.codeswithchandan.com/api/places

Response format: JSON. Example fields include id, title, imagePath, bookingLink, city.

Authentication Required

Authorization: Bearer <YOUR_API_KEY>
Important: All requests must include the Authorization header. Requests without proper authentication will return HTTP 403.
Header Required

Quick cURL Example

curl -s -H "Authorization: Bearer <YOUR_API_KEY>" \
  "https://places.codeswithchandan.com/api/places"

JavaScript (fetch)

fetch('https://places.codeswithchandan.com/api/places', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer <YOUR_API_KEY>',
    'Accept': 'application/json'
  }
})
.then(r => r.json())
.then(data => console.log(data))
.catch(err => console.error(err));

Axios (React / Node)

import axios from 'axios';

axios.get('https://places.codeswithchandan.com/api/places', {
  headers: { Authorization: 'Bearer <YOUR_API_KEY>' }
})
.then(res => console.log(res.data))
.catch(err => console.error(err));

Testing with Postman

  1. Open Postman → New Request → GET the endpoint above
  2. Navigate to Headers tab
  3. Add: Authorization = Bearer <YOUR_API_KEY>
  4. Click Send to test the request
HTTP 403: Check Auth Header HTTP 500: Check Server Logs

Important Notes

  • CORS: Ensure your server allows your domain origin for browser-based requests
  • Security: Never expose API keys in client-side code. Use environment variables or server-side proxies
  • Rate Limits: Be respectful with request frequency to ensure service availability

Example Response

{
  "status": "success",
  "data": [
    {
      "id": "9",
      "title": "Tughlaqabad Fort",
      "imagePath": "places/tughlaqabad-fort.jpg",
      "bookingLink": "https://asi.payumoney.com/quick/tqf",
      "city": "Delhi"
    }
  ],
  "meta": {
    "total": 150,
    "page": 1,
    "per_page": 20
  }
}
JSON Format

Need API Access?

Get your dedicated API key for production use. We offer different tiers based on your needs.

Get API Key

Include your name, application details, and expected usage volume.