To get the link or the embed code of a file uploaded using Openload's remote upload API, you can make use of Openload's getFileInfo
API endpoint.
Here's how you can do it in Python using the requests library:
import requests
API_LOGIN = 'your_api_login'
API_KEY = 'your_api_key'
FILE_ID = 'your_file_id'
# Construct the API endpoint URL
url = f'https://api.openload.co/1/file/info?login={API_LOGIN}&key={API_KEY}&file={FILE_ID}'
# Send a GET request to the API endpoint
response = requests.get(url)
# Parse the response JSON to get the file URL and embed code
json_response = response.json()
file_url = json_response['result']['url']
embed_code = json_response['result']['embed']
The getFileInfo API endpoint returns a JSON response that contains the file URL and the embed code in the result object. We can parse the JSON response using the response.json()
method and extract the URL and embed code from the result
object.