How abdipr/myinstants-api works
MyInstants REST API exposes sound discovery, detail, and user-profile data by scraping MyInstants pages and returning JSON. Clients call separate endpoints; list endpoints fetch pages and share sound extraction, while detail extracts richer metadata. The shared helper also handles JSON/error responses and cache/CORS headers. README documents edge caching and serverless deployment; source excerpts show response headers but not deployment configuration, so the graph focuses on runtime behavior. The local router is shown only as an optional path to endpoint dispatch.
Main entry points: router.php Local router · helper.php JSON responses · detail.php Sound detail · search.php Sound search
Components 16
API endpoints
- Local router
router.php - Root endpoint
api/index.php - 404 endpoint
api/404.php - Sound search
api/search.php - Sound detail
api/detail.php - Trending sounds
api/trending.php - Best sounds
api/best.php - Recent sounds
api/recent.php - User uploads
api/uploaded.php - User favorites
api/favorites.php
Scraping and parsing
- Scrape helpers
api/helper.php - HTML parser
api/simple_html_dom.php
Response handling
- JSON responses
api/helper.php
Other components
- API client
- MyInstants website
- Edge cache
Connections 38
- API client → Root endpoint: requests
- API client → Sound search: requests
- API client → Sound detail: requests
- API client → Trending sounds: requests
- API client → Best sounds: requests
- API client → Recent sounds: requests
- API client → User uploads: requests
- API client → User favorites: requests
- Local router → Root endpoint: dispatches
- Local router → Sound search: dispatches
- Local router → Sound detail: dispatches
- Local router → Trending sounds: dispatches
- Local router → Best sounds: dispatches
- Local router → Recent sounds: dispatches
- Local router → User uploads: dispatches
- Local router → User favorites: dispatches
- Local router → 404 endpoint: dispatches
- API client → 404 endpoint: requests
- Sound search → Scrape helpers: fetches and parses
- Trending sounds → Scrape helpers: fetches and parses
- Best sounds → Scrape helpers: fetches and parses
- Recent sounds → Scrape helpers: fetches and parses
- User uploads → Scrape helpers: fetches and parses
- User favorites → Scrape helpers: fetches and parses
- Sound detail → Scrape helpers: fetches page
- Scrape helpers → MyInstants website: requests HTML
- Scrape helpers → HTML parser: parses HTML
- Sound detail → HTML parser: extracts metadata
- Sound search → JSON responses: formats results
- Sound detail → JSON responses: formats results
- Trending sounds → JSON responses: formats results
- Best sounds → JSON responses: formats results
- Recent sounds → JSON responses: formats results
- User uploads → JSON responses: formats results
- User favorites → JSON responses: formats results
- 404 endpoint → JSON responses: formats error
- JSON responses → API client: returns JSON
- JSON responses → Edge cache: sets cache headers