README.md
June 3, 2026 ยท View on GitHub
![]()
MyInstants REST API
A RESTful API for scraping and retrieving sound data from the MyInstants website. This API provides endpoints for retrieving information about sounds, including titles, URLs, descriptions, tags, favorites, views, and uploader details.
โจ Features
- โก Ultra Fast: Powered by Vercel Edge Caching (
s-maxage=3600) for ~0ms response times on cached requests. - ๐ Serverless Ready: Native deployment to Vercel without tweaking. Uses separate serverless functions for maximum efficiency.
- ๐ CORS Enabled: Ready to be consumed directly from frontend web applications (React, Vue, etc) without cross-origin issues.
- ๐ฏ Reliable Error Handling: Returns proper HTTP status codes (e.g., 404, 400) instead of just 200 OK.
Table of Contents
- Features
- Getting Started
- Reference
- Error Handling
- Examples
- Contributing
- Support
- License & Disclaimer
๐ Getting Started
Requirements
- PHP 7.4 or higher
- simple_html_dom.php library for HTML parsing
curlextension enabled inphp.ini
Installation
-
Clone the repository to your server:
git clone https://github.com/abdipr/myinstants-api.git cd myinstants-api -
Download and include
simple_html_dom.phpin the project directory. -
Local Development (No Apache/Nginx required): You can run the API locally using PHP's built-in web server. This project includes a
router.phpfile that perfectly simulates Vercel's serverless routing environment, allowing you to access endpoints without the.phpextension.php -S localhost:8000 router.phpNow you can access the API locally (e.g.,
http://localhost:8000/best?q=id). -
Deploy to Vercel: Deploying is simple. Click the button below to deploy this repository directly to your Vercel account.
โ๏ธ Reference
Endpoints
Base URL: https://myinstants-api.vercel.app
| Request | Response | Parameter |
|---|---|---|
GET /trending | Trending based region | q |
GET /search | Search a sound | q |
GET /detail | The sound details | id |
GET /recent | Recently uploaded sounds | |
GET /best | Best of all time sounds | q |
GET /uploaded | User's uploaded sounds | username |
GET /favorites | User's favorite sounds | username |
Request Parameters
| Parameter | Description |
|---|---|
q | Search query or region |
username | User's username |
id | Sound's Unique ID |
Response Example
A typical successful response (HTTP 200) will return a JSON object like this:
{
"status": 200,
"author": "abdipr",
"data": [
{
"id": "vine-boom-sound-70972",
"title": "VINE BOOM SOUND",
"url": "https://www.myinstants.com/en/instant/vine-boom-sound-70972/",
"mp3": "https://www.myinstants.com/media/sounds/vine-boom.mp3"
}
]
}
Note: For the /detail endpoint, the data object will contain extra fields like description, tags, favorites, views, and uploader.
๐ฅ Error Handling
All errors return JSON objects with an appropriate HTTP status code (e.g., 404, 400) and a message explaining the issue.
- 404 Error:
- When the page is not found or an invalid endpoint is accessed.
{ "status": 404, "author": "abdipr", "message": "Endpoint not found" }
๐ Examples
Example 1: Get Trending Sounds by Region
GET https://myinstants-api.vercel.app/trending?q=id
Example 2: Search Sounds by Query
GET https://myinstants-api.vercel.app/search?q=laugh
Example 3: Get Sound Details by ID
GET https://myinstants-api.vercel.app/detail?id=akh-26815
Example 4: Get Recently Uploaded Sounds
GET https://myinstants-api.vercel.app/recent
Example 5: Get Best of All Time Sounds
Retrieve a list of the most popular sounds of all time based on a specified region:
GET https://myinstants-api.vercel.app/best?q=id
Example 6: Get User's Uploaded Sounds
GET https://myinstants-api.vercel.app/uploaded?username=hellmouz
Example 7: Get User's Favorite Sounds
GET https://myinstants-api.vercel.app/favorites?username=hellmouz
๐ฑ Contributing
Contributions are welcome! To contribute:
- Fork the repository.
- Create a feature branch:
git checkout -b feature-name. - Commit your changes:
git commit -m 'Add feature'. - Push to the branch:
git push origin feature-name. - Submit a pull request.
โจ Support
If you like this project, please star on this repository, thank you โญ
You can support me by:

โ๏ธ License
This project is licensed under the MIT License. See the LICENSE file for more information.
โ ๏ธ Disclaimer
The sounds contained in this API are obtained from the original MyInstants website by web scraping. Developers using this API must follow the applicable regulations by mentioning this project or the official owner in their projects and are prohibited from abusing this API for personal benefits.