Metadata của một tệp media
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, // Tính bằng giây
"filename": "https://img.ayrshare.com/random/landscape16.mp4",
"format": "QuickTime / MOV",
"height": 1080,
"size": 16275959, // Tính bằng byte
"type": "video",
"width": 1920
}
{
"action": "post",
"status": "error",
"code": 229,
"message": "Error validating video. Please check the video or URL."
}
Media
Metadata của một tệp media
Lấy metadata của một URL tệp media
GET
/
media
/
meta
Metadata của một tệp media
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, // Tính bằng giây
"filename": "https://img.ayrshare.com/random/landscape16.mp4",
"format": "QuickTime / MOV",
"height": 1080,
"size": 16275959, // Tính bằng byte
"type": "video",
"width": 1920
}
{
"action": "post",
"status": "error",
"code": 229,
"message": "Error validating video. Please check the video or URL."
}
Truy xuất metadata của một URL tệp media để kiểm tra định dạng, kích thước và các chi tiết khác.
Tham số Header
Tham số Query
URI đã được mã hóa của URL tệp media có thể truy cập từ bên ngoài.
{
"codec": "h264",
"duration": 28.24, // Tính bằng giây
"filename": "https://img.ayrshare.com/random/landscape16.mp4",
"format": "QuickTime / MOV",
"height": 1080,
"size": 16275959, // Tính bằng byte
"type": "video",
"width": 1920
}
{
"action": "post",
"status": "error",
"code": 229,
"message": "Error validating video. Please check the video or URL."
}
⌘I
