{
  "openapi": "3.0.1",
  "info": {
    "title": "Audio to MIDI Converter API: MP3, WAV to MIDI, Notes, Key",
    "description": "Convert MP3, WAV, FLAC or MP4 audio URLs to MIDI files with Spotify Basic Pitch: .mid download, note list (pitch, timing, velocity), tempo BPM, key and pitch range. $0.01 per audio minute.",
    "version": "1.0",
    "x-build-id": "etenHta3M19ezsbL3"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/magnova~audio-to-midi-converter/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-magnova-audio-to-midi-converter",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/magnova~audio-to-midi-converter/runs": {
      "post": {
        "operationId": "runs-sync-magnova-audio-to-midi-converter",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/magnova~audio-to-midi-converter/run-sync": {
      "post": {
        "operationId": "run-sync-magnova-audio-to-midi-converter",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "sources"
        ],
        "properties": {
          "sources": {
            "title": "Audio or video file URLs",
            "type": "array",
            "description": "Direct links to audio or video files you own or have rights to: MP3, WAV, M4A/AAC, FLAC, OGG, OPUS, AIFF, MP4, MOV or WEBM. Each file becomes one .mid file plus a note list. Works best on solo instruments and vocals (piano, guitar, violin, flute, singing, humming). YouTube, Spotify, SoundCloud, TikTok, Instagram and other streaming or social page URLs are rejected for free. Example: https://upload.wikimedia.org/wikipedia/commons/3/37/00_Jazz_Violin_Solo.ogg",
            "items": {
              "type": "string"
            }
          },
          "onsetThreshold": {
            "title": "Note onset threshold",
            "minimum": 0.05,
            "maximum": 0.95,
            "type": "number",
            "description": "How confident the model must be that a new note starts (0.05-0.95). Lower = more notes (catches soft notes, more false positives); higher = fewer, cleaner notes. Basic Pitch default 0.5. Example: 0.6 for a noisy recording.",
            "default": 0.5
          },
          "frameThreshold": {
            "title": "Note frame threshold",
            "minimum": 0.05,
            "maximum": 0.95,
            "type": "number",
            "description": "How confident the model must be that a note is still sounding (0.05-0.95). Lower = longer notes, higher = shorter notes. Basic Pitch default 0.3. Example: 0.4.",
            "default": 0.3
          },
          "minNoteLengthMs": {
            "title": "Minimum note length (ms)",
            "minimum": 10,
            "maximum": 2000,
            "type": "number",
            "description": "Notes shorter than this are dropped. Raise it to remove flutter and ghost notes, lower it for fast passages. Default 127.7 ms (Basic Pitch default). Example: 60 for fast guitar runs.",
            "default": 127.7
          },
          "minFrequencyHz": {
            "title": "Lowest note frequency (Hz)",
            "minimum": 20,
            "maximum": 8000,
            "type": "number",
            "description": "Optional: ignore notes below this frequency. Useful to drop rumble or octave errors, e.g. 190 Hz for violin (lowest string G3 = 196 Hz), 80 Hz for guitar, 27.5 Hz for full piano. Leave empty for no limit. Example: 190."
          },
          "maxFrequencyHz": {
            "title": "Highest note frequency (Hz)",
            "minimum": 20,
            "maximum": 12000,
            "type": "number",
            "description": "Optional: ignore notes above this frequency, e.g. 1100 Hz for a sung melody. Leave empty for no limit. Example: 1100."
          },
          "includeNotes": {
            "title": "Include note list in results",
            "type": "boolean",
            "description": "Add the notes array (start, end, MIDI pitch, note name, velocity) to each result row (first 10,000 notes; the full list is always available at notesJsonUrl). Turn off for smaller rows when you only need the MIDI file.",
            "default": true
          },
          "maxMinutesPerFile": {
            "title": "Max minutes per file",
            "minimum": 0.1,
            "maximum": 1440,
            "type": "number",
            "description": "Optional cap: convert only the first N minutes of each file (you pay only for what is converted). Leave empty for full files. Example: 5."
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 4000,
            "type": "integer",
            "description": "Files larger than this are skipped with an error row (not charged). Example: 500.",
            "default": 500
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}