How rajatdhoot123/indian-courier-api works
This is a Next.js courier-tracking app and JSON API. A user can enter a carrier and tracking ID in the web UI, but the UI's request path does not match the documented API route, so that connection is not shown as working. The documented API workflow accepts a courier and tracking ID, loads AfterShip's tracking page in a browser, extracts checkpoint data, and returns JSON. The README lists supported carriers; the sampled endpoint uses AfterShip for tracking. The graph separates endpoint handling, browser access, and parsing, though these implementation stages share one source file.
Main entry points: pages/index.page.js Tracking form · [trackingId]/index.page.js Tracking endpoint · index.js Carrier options
Components 14
Web interface
- Tracking form
pages/index.page.js - Carrier options
constants/index.js - Results table
pages/index.page.js - Failure message
pages/index.page.js - API caller
pages/index.page.js
Tracking API
- Tracking endpoint
pages/api/track/[courier]/[trackingId]/index.page.js - JSON result
pages/api/track/[courier]/[trackingId]/index.page.js
Tracking runtime
- Browser page setup
pages/api/track/[courier]/[trackingId]/index.page.js - Headless browser
- Checkpoint extraction
pages/api/track/[courier]/[trackingId]/index.page.js - HTML parser
pages/api/track/[courier]/[trackingId]/index.page.js
Other components
- Tracking user
- API consumer
- AfterShip tracking
Connections 13
- Tracking user → Tracking form: enters tracking
pages/index.page.js - Tracking form → Carrier options: renders choices
pages/index.page.js - Tracking form → API caller: submits lookup
pages/index.page.js - API caller → Tracking endpoint
- Tracking form → Results table: renders results
pages/index.page.js - Tracking form → Failure message: renders failure
pages/index.page.js - API consumer → Tracking endpoint: requests tracking
README.md - Tracking endpoint → Browser page setup: creates page
pages/api/track/[courier]/[trackingId]/index.page.js - Browser page setup → Headless browser: launches browser
pages/api/track/[courier]/[trackingId]/index.page.js - Browser page setup → AfterShip tracking: navigates to
pages/api/track/[courier]/[trackingId]/index.page.js - Tracking endpoint → Checkpoint extraction: reads page content
pages/api/track/[courier]/[trackingId]/index.page.js - Checkpoint extraction → HTML parser: parses HTML
pages/api/track/[courier]/[trackingId]/index.page.js - Tracking endpoint → JSON result: returns JSON
pages/api/track/[courier]/[trackingId]/index.page.js