MIDIsss Public API Documentation
Welcome to the MIDIsss API! This simple API allows you to programmatically search for MIDI files hosted on our site and download them directly.
Base URL
All API requests start with the following base URL:
http://midisss.com/api.php
General Notes
- All requests use the HTTP GET method.
- The
action
parameter is required to specify the desired operation. - Error responses are returned in JSON format with appropriate HTTP status codes (e.g., 400 for bad requests, 404 for not found, 500 for server errors).
1. Search MIDI Files
Searches the MIDI library based on a query string. Matches are searched against MIDI names, album names, and notes.
URL:
GET http://midisss.com/api.php?action=search&q={search_query}
Parameters:
action
(string, required): Must besearch
.q
(string, required): Your search term (e.g.,mozart
).
Success Response (200 OK):
Returns a JSON array of matching MIDI objects. Each object includes:
id
(integer): The unique ID of the MIDI.name
(string): The name of the MIDI file.notes
(string): Associated notes (can be empty).average_rating
(float): The average user rating (rounded to one decimal place).
Example Response:
[
{
"id": 5,
"name": "Mozart Symphony No. 40",
"notes": "Arrangement for piano.",
"average_rating": 4.8
},
{
"id": 12,
"name": "Eine Kleine Nachtmusik - Mozart",
"notes": "",
"average_rating": 4.2
}
]
An empty array []
is returned if no matches are found.
Error Responses:
400 Bad Request
: If theq
parameter is missing. Example:{"error": "Search query (q) is required."}
500 Internal Server Error
: If a database error occurs.
2. Download MIDI File
Retrieves the actual MIDI file data for a given MIDI ID, usually prompting a download in the browser.
URL:
GET http://midisss.com/api.php?action=get_midi&id={midi_id}
Parameters:
action
(string, required): Must beget_midi
.id
(integer, required): The ID of the MIDI file to download (e.g.,5
).
Success Response (200 OK):
- Content-Type:
audio/midi
- Content-Disposition:
attachment; filename="{midi_name}.mid"
- Body: The raw binary data of the MIDI file.
Error Responses:
400 Bad Request
: If theid
parameter is missing or invalid. Example:{"error": "Valid MIDI ID (id) is required."}
404 Not Found
: If the MIDI ID does not exist or the file is missing on the server. Example:{"error": "MIDI record not found."}
or{"error": "MIDI file not found on server."}
500 Internal Server Error
: If a database error occurs.
Important Considerations:
- Please use this API responsibly. Excessive requests may be throttled.
- Remember that all MIDI files are user-uploaded and subject to our Terms and Conditions, primarily intended for personal and educational use.