Media file पर Metadata
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, // सेकंड में
"filename": "https://img.ayrshare.com/random/landscape16.mp4",
"format": "QuickTime / MOV",
"height": 1080,
"size": 16275959, // bytes में
"type": "video",
"width": 1920
}
{
"action": "post",
"status": "error",
"code": 229,
"message": "Error validating video. Please check the video or URL."
}
{
"action": "post",
"status": "error",
"code": 499,
"message": "Ayrshare's media probe service is temporarily unavailable. Please retry shortly.",
"retryAvailable": true
}
Media
Media file पर Metadata
बाहरी रूप से सुलभ मीडिया फ़ाइल URL का metadata प्राप्त करें, जैसे उसका format, codec, चौड़ाई, ऊँचाई, सेकंड में अवधि, बाइट्स में आकार और प्रकार।
GET
/
media
/
meta
Media file पर Metadata
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, // सेकंड में
"filename": "https://img.ayrshare.com/random/landscape16.mp4",
"format": "QuickTime / MOV",
"height": 1080,
"size": 16275959, // bytes में
"type": "video",
"width": 1920
}
{
"action": "post",
"status": "error",
"code": 229,
"message": "Error validating video. Please check the video or URL."
}
{
"action": "post",
"status": "error",
"code": 499,
"message": "Ayrshare's media probe service is temporarily unavailable. Please retry shortly.",
"retryAvailable": true
}
format, dimensions, और अन्य विवरण जाँचने के लिए media file URL पर metadata प्राप्त करें।
Header Parameters
Query Parameters
{
"codec": "h264",
"duration": 28.24, // सेकंड में
"filename": "https://img.ayrshare.com/random/landscape16.mp4",
"format": "QuickTime / MOV",
"height": 1080,
"size": 16275959, // bytes में
"type": "video",
"width": 1920
}
{
"action": "post",
"status": "error",
"code": 229,
"message": "Error validating video. Please check the video or URL."
}
{
"action": "post",
"status": "error",
"code": 499,
"message": "Ayrshare's media probe service is temporarily unavailable. Please retry shortly.",
"retryAvailable": true
}