Metadata on a media file
curl --request GET \
--url https://api.ayrshare.com/api/media/meta \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ayrshare.com/api/media/meta', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.ayrshare.com/api/media/meta"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ayrshare.com/api/media/meta",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.ayrshare.com/api/media/meta"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.ayrshare.com/api/media/meta")
.header("Authorization", "Bearer <token>")
.asString();{
"codec": "h264",
"duration": 28.24, // In seconds
"filename": "https://img.ayrshare.com/random/landscape16.mp4",
"format": "QuickTime / MOV",
"height": 1080,
"size": 16275959, // In bytes
"type": "video",
"width": 1920
}
{
"action": "post",
"status": "error",
"code": 229,
"message": "Error validating video. Please check the video or URL."
}
Media
Metadata on a media file
Get the metadata on a media file URL
GET
/
media
/
meta
Metadata on a media file
curl --request GET \
--url https://api.ayrshare.com/api/media/meta \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ayrshare.com/api/media/meta', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.ayrshare.com/api/media/meta"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ayrshare.com/api/media/meta",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.ayrshare.com/api/media/meta"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.ayrshare.com/api/media/meta")
.header("Authorization", "Bearer <token>")
.asString();{
"codec": "h264",
"duration": 28.24, // In seconds
"filename": "https://img.ayrshare.com/random/landscape16.mp4",
"format": "QuickTime / MOV",
"height": 1080,
"size": 16275959, // In bytes
"type": "video",
"width": 1920
}
{
"action": "post",
"status": "error",
"code": 229,
"message": "Error validating video. Please check the video or URL."
}
Retrieve the metadata on a media file URL to check format, dimensions, and other details.
Header Parameters
Query Parameters
Encoded URI of the externally accessible media file URL.
{
"codec": "h264",
"duration": 28.24, // In seconds
"filename": "https://img.ayrshare.com/random/landscape16.mp4",
"format": "QuickTime / MOV",
"height": 1080,
"size": 16275959, // In bytes
"type": "video",
"width": 1920
}
{
"action": "post",
"status": "error",
"code": 229,
"message": "Error validating video. Please check the video or URL."
}
⌘I
