API Documentation

App.apiDescription

Getting Started

To use the YTMP3CV.COM API, you'll need an API key. If you don't have one yet, contact us to get started.

All API requests should be made to the following base URL:

https://api.ytmp3cv.com/

Authentication

Include your API key in the header of all requests:

Authorization: Bearer YOUR_API_KEY

Endpoints

Convert YouTube to MP3

POST /convert

Convert a YouTube video to MP3 format.

Parameters

Name Type Description
url string The YouTube video URL
quality string Optional. Audio quality (high, medium, low). Default: high

Example Request


import requests

api_key = 'YOUR_API_KEY'
headers = {
    'Authorization': f'Bearer {api_key}',
    'Content-Type': 'application/json'
}

data = {
    'url': 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',
    'quality': 'high'
}

response = requests.post('https://api.ytmp3cv.com/convert', headers=headers, json=data)

if response.status_code == 200:
    result = response.json()
    print(f"Download URL: {result['download_url']}")
else:
    print(f"Error: {response.status_code}")
                    

Get Conversion Status

GET /status/{conversion_id}

Check the status of a conversion job.

Parameters

Name Type Description
conversion_id string The ID of the conversion job

Example Request


import requests

api_key = 'YOUR_API_KEY'
headers = {
    'Authorization': f'Bearer {api_key}'
}

conversion_id = 'abc123'
response = requests.get(f'https://api.ytmp3cv.com/status/{conversion_id}', headers=headers)

if response.status_code == 200:
    result = response.json()
    print(f"Status: {result['status']}")
    print(f"Progress: {result['progress']}%")
else:
    print(f"Error: {response.status_code}")
                    

Batch Conversion

POST /batch-convert

Convert multiple YouTube videos to MP3 format in a single request.

Parameters

Name Type Description
urls array An array of YouTube video URLs
quality string Optional. Audio quality (high, medium, low). Default: high

Example Request


import requests

api_key = 'YOUR_API_KEY'
headers = {
    'Authorization': f'Bearer {api_key}',
    'Content-Type': 'application/json'
}

data = {
    'urls': [
        'https://www.youtube.com/watch?v=dQw4w9WgXcQ',
        'https://www.youtube.com/watch?v=9bZkp7q19f0'
    ],
    'quality': 'high'
}

response = requests.post('https://api.ytmp3cv.com/batch-convert', headers=headers, json=data)

if response.status_code == 200:
    result = response.json()
    for job in result['jobs']:
        print(f"Conversion ID: {job['conversion_id']}")
else:
    print(f"Error: {response.status_code}")
                    

Rate Limiting

To ensure fair usage and maintain service quality, our API implements rate limiting. The current limits are:

Time Frame Request Limit
Per Minute 100 requests
Per Hour 1,000 requests
Per Day 10,000 requests

If you exceed these limits, you'll receive a 429 Too Many Requests response. The response will include the following headers:

  • X-RateLimit-Limit: The rate limit ceiling for that given request
  • X-RateLimit-Remaining: The number of requests left for the time window
  • X-RateLimit-Reset: The remaining window before the rate limit resets in UTC epoch seconds

For higher rate limits tailored to your specific use case, please contact our sales team.

Error Handling

Description

Code Description
200 OK The request was successful.
400 Bad Request The request was invalid or cannot be served. The exact error is explained in the error message.
401 Unauthorized The request requires user authentication.
403 Forbidden The server understood the request but refuses to authorize it.
404 Not Found The requested resource could not be found.
429 Too Many Requests You have sent too many requests in a given amount of time.
500 Internal Server Error We had a problem with our server. Try again later.

All error responses will include a JSON object in the response body with the following structure:


{
    "error": {
        "code": "ERROR_CODE",
        "message": "A human-readable error message"
    }
}
                

We recommend implementing proper error handling in your application to gracefully manage these scenarios and provide a smooth user experience.

Get Started with Our API

Ready to integrate our powerful YouTube to MP3 conversion into your application?

Contact Sales