Sgrìobhainnean API

Airson prìsean API cliog an seo

Tha Soundc.com API air a chumail aig dvr.soundc.com .


Dearbhadh

Gus faighinn gu Soundc.com API, feumaidh tu an iuchair API sònraichte agad a thoirt a-steach. Gheibh thu iuchair API le bhith a’ clàradh leis an t-seòladh post-d agad. Feuch an cuimhnich thu an iuchair API agad a chumail dìomhair.

Tha dearbhadh leis an API air a làimhseachadh tro chinn-cinn HTTP. Feumaidh a h-uile iarrtas bann-cinn Ùghdarrachaidh anns a bheil an iuchair API agad san iuchair fòrmat: YOUR_API_KEY , far a bheil YOUR_API_KEY an iuchair a tha ri làimh air duilleag a’ chunntais agad.

Airson tèarainteachd, feumar a h-uile iarrtas a chuir thairis air ceangal crioptaichte HTTPS gus an dàta agad a dhìon aig àm tar-chuir.


Atharrachadh ann an cruth mp3

Cuir URL bhidio / claisneachd chun API Soundc.com airson atharrachadh cruth MP3. Lorgaidh an API am fuaim / bhidio gu fèin-ghluasadach agus ullaichidh e airson an ath-chluich as fheàrr air diofar innealan.

Eisimpleir airson atharrachadh cruth mp3

Cuir an iuchair API shònraichte agad na àite YOUR_API_KEY (a lorgar air duilleag a’ chunntais Soundc.com agad) agus cuir an URL claisneachd / bhidio na àite AUDIO_URL:

import requests
import base64

headers = {"Authorization": "API_KEY"}
video_url = base64.b64encode("VIDEO_URL".encode()).decode()
r = requests.post(
    url="https://dvr.soundc.com/mp3",
    headers=headers,
    data={
        "video_url": video_url,
        "start_time": False,
        "end_time": False,
        "title": "Hello world",
        "artist": "Hello world",
        "audio_quality": '128k',
    }
)

if r.status_code == 200:
    with open("audio.mp3", "wb") as fd:
        for chunk in r.iter_content(chunk_size=128):
            fd.write(chunk)
else:
    print(r.status_code)
    print(r.text)
const axios = require('axios');

const headers = {
  Authorization: "API_KEY"
};

const videoUrl = Buffer.from("VIDEO_URL").toString('base64');

const data = {
  video_url: videoUrl,
  start_time: false,
  end_time: false,
  title: "Hello world",
  artist: "Hello world",
  audio_quality: "128k"
};

axios
  .post("https://dvr.soundc.com/mp3", data, { headers })
  .then(response => {
    const fs = require('fs');
    const fileStream = fs.createWriteStream("audio.mp3");

    response.data.pipe(fileStream);

    fileStream.on('finish', () => {
      console.log("Archivo descargado con éxito como audio.mp3");
    });

    fileStream.on('error', error => {
      console.error("Error al escribir el archivo:", error);
    });
  })
  .catch(error => {
    console.error("Error en la solicitud:", error);
  });
<?php
$video_url = base64_encode("VIDEO_URL");

$data = [
    "video_url" => $video_url,
    "start_time" => "false",
    "end_time" => "false",
    "title" => "Hello world",
    "artist" => "Hello world",
    "audio_quality" => "128k",
    "format" => "mp3"
];

$postData = http_build_query($data);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://dvr.soundc.com/mp3");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Authorization: API_KEY",
    "Content-Type: application/x-www-form-urlencoded"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode === 200) {
    file_put_contents("audio.mp3", $response);
    echo "✅ audio.mp3";
} else {
    echo "❌ $httpCode\n";
    echo $response;
}
?>
curl -L -X POST "https://dvr.soundc.com/mp3" \
    -H "Authorization: API_KEY" \
    -H "Content-Type: application/x-www-form-urlencoded" \
    --data-urlencode "video_url=$(echo -n 'VIDEO_URL' | base64)" \
    --data-urlencode "start_time=false" \
    --data-urlencode "end_time=false" \
    --data-urlencode "title=Hello world" \
    --data-urlencode "artist=Hello world" \
    --data-urlencode "audio_quality=128k" \
    --data-urlencode "format=mp3" \
    --output "audio.mp3" --silent --show-error --write-out "\nHTTP_STATUS=%{http_code}"

Ag atharrachadh an cruth MP4

Cuir URL bhidio / claisneachd chun API Soundc.com airson cruth MP4 atharrachadh. Lorgaidh an API am fuaim / bhidio gu fèin-ghluasadach agus ullaichidh e airson an ath-chluich as fheàrr air diofar innealan.

Eisimpleir airson atharrachadh cruth MP4

Cuir an iuchair API shònraichte agad na àite YOUR_API_KEY (a lorgar air duilleag a’ chunntais Soundc.com agad) agus cuir an URL claisneachd / bhidio na àite VIDEO_URL:

import requests
import base64

headers = {"Authorization": "API_KEY"}
video_url = base64.b64encode("VIDEO_URL".encode()).decode()
r = requests.post(
    url="https://dvr.soundc.com/mp4",
    headers=headers,
    data={
        "video_url": video_url,
        "start_time": False,
        "end_time": False,
        "title": "hello world",
        "video_quality": 720
    }
)

if r.status_code == 200:
    with open("video.mp4", "wb") as fd:
        for chunk in r.iter_content(chunk_size=128):
            fd.write(chunk)
else:
    print(r.status_code)
    print(r.text)
const axios = require('axios');

const headers = {
  Authorization: "API_KEY"
};

const videoUrl = Buffer.from("VIDEO_URL").toString('base64');

const data = {
  video_url: videoUrl,
  start_time: false,
  end_time: false,
  title" "hello world",
  video_quality: 720
};

axios
  .post("https://dvr.soundc.com/mp3", data, { headers })
  .then(response => {
    const fs = require('fs');
    const fileStream = fs.createWriteStream("audio.mp3");

    response.data.pipe(fileStream);

    fileStream.on('finish', () => {
      console.log("Archivo descargado con éxito como audio.mp3");
    });

    fileStream.on('error', error => {
      console.error("Error al escribir el archivo:", error);
    });
  })
  .catch(error => {
    console.error("Error en la solicitud:", error);
  });
<?php
$video_url = base64_encode("VIDEO_URL");

$data = [
    "video_url" => $video_url,
    "start_time" => "false",
    "end_time" => "false",
    "title" => "Hello world",
    "video_quality" => "720"
];

$postData = http_build_query($data);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://dvr.soundc.com/mp4");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Authorization: API_KEY",
    "Content-Type: application/x-www-form-urlencoded"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode === 200) {
    file_put_contents("video.mp4", $response);
    echo "✅ video.mp4";
} else {
    echo "❌ $httpCode\n";
    echo $response;
}
?>
curl -L -X POST "https://dvr.soundc.com/mp4" \
     -H "Authorization: API_KEY" \
     -H "Content-Type: application/x-www-form-urlencoded" \
     --data-urlencode "video_url=$(echo -n 'VIDEO_URL' | base64)" \
     --data-urlencode "start_time=false" \
     --data-urlencode "end_time=false" \
     --data-urlencode "title=hello world" \
     --data-urlencode "video_quality=720" \
     --data-urlencode "format=mp4" \
     --output video.mp4 --silent --show-error --write-out "\nHTTP_STATUS=%{http_code}"

Glossary of parameters

video_url
string (required)

An URL claisneachd / bhidio ann am base64. Thoir sùil air na duilleagan air fad a tha sinn a’ toirt taic. Cliog an seo

start_time
int

Tha seo air a chleachdadh gus an claisneachd no bhidio a ghearradh agus a’ riochdachadh an dàrna fear aig a bheil thu airson gun tòisich an clàradh claisneachd / bhidio. Faodaidh tu false a chuir a-steach gus innse gum bu chòir dha tòiseachadh bhon 0mh diog.

end_time
int / bool (false)

Tha seo air a chleachdadh gus an claisneachd no bhidio a ghearradh agus a’ riochdachadh an dàrna fear aig a bheil thu airson gun tig an clàradh claisneachd / bhidio gu crìch. Faodaidh tu <code>false</code> a chuir mura h-eil thu airson am fuaim / bhidio a ghearradh.

title
string (required)

An tiotal fon tèid am fuaim/bhidio a chlàradh; tha e cuideachd air a chleachdadh gus am faidhle a chaidh a chruthachadh ainmeachadh.

artist
string

Ainm an neach-ealain fon tèid am faidhle a chlàradh.

audio_quality
string

An càileachd aig an tèid am faidhle claisneachd a chlàradh. Is e na feartan a tha rim faighinn 32k , 64k , 128k , 256k , no 320k .

video_quality
string

An càileachd aig an tèid am faidhle bhidio a chlàradh. Is e na feartan a tha rim faighinn 144 , 240 , 360 , 480 , 720 (Airson HD), 1080 (Airson UHD), 2160 (Airson 4k), no 4320 (Airson 8k).

API Poileasaidh Dìomhaireachd Teirmean seirbheis Cuir fios thugainn Lean sinn air BlueSky

2025 Soundc LLC | Air a dhèanamh le nadermx