API
General
API-ul este disponibil tuturor utilizatorilor Premium ce au cerut o cheie de acces. Impunem o limita de 60 de cereri/minut.
Va oferim endpoint-uri de acces catre principalele resurse disponibile pe DescarcaGratis, incluzand Jocurile, Filme si Serialele.
Termeni
Resursa: reprezinta un singur model (Joc, Film sau Serial), oferind toate detaliile aferente acestuia.
Colectie: reprezinta insumarea tuturor resurselor unui model (Joc, Film sau Serial). Aceasta se foloseste de paginatie pentru a naviga prin intreaga colectie de resurse, si ofera detaliile minime pentru fiecare model.
Jocuri
Colectie
GET/api/1/game?api_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&page={page_number}
Acest endpoint este folosit pentru a lista intreaga colectie de jocuri
Resursa
GET/api/1/game/{game_id}?api_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Acest endpoint este folosit pentru a lista resursa unui joc
curl -X GET \ 'https://www.descarcagratis.com/api/1/game/1?api_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \ -H 'cache-control: no-cache' \
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://www.descarcagratis.com/api/1/game/1?api_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "cache-control: no-cache", ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
require 'uri' require 'net/http' url = URI("https://www.descarcagratis.com/api/1/game/1?api_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) request["cache-control"] = 'no-cache' response = http.request(request) puts response.read_body
import requests url = "https://www.descarcagratis.com/api/1/game/1" querystring = {"api_token":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"} headers = { 'cache-control': "no-cache", } response = requests.request("GET", url, headers=headers, params=querystring) print(response.text)
var settings = { "async": true, "crossDomain": true, "url": "https://www.descarcagratis.com/api/1/game/1?api_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "method": "GET", "headers": { "cache-control": "no-cache", } } $.ajax(settings).done(function (response) { console.log(response); });
var http = require("https"); var options = { "method": "GET", "hostname": "www.descarcagratis.com", "port": null, "path": "/api/1/game/1?api_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "headers": { "cache-control": "no-cache", } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://www.descarcagratis.com/api/1/game/1?api_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("cache-control", "no-cache") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
Filme
Colectie
GET/api/1/movie?api_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&page={page_number}
Acest endpoint este folosit pentru a lista intreaga colectie de filme
Resursa
GET/api/1/movie/{movie_id}?api_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Acest endpoint este folosit pentru a lista resursa unui film
curl -X GET \ 'https://www.descarcagratis.com/api/1/movie/1?api_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \ -H 'cache-control: no-cache' \
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://www.descarcagratis.com/api/1/movie/1?api_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "cache-control: no-cache", ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
require 'uri' require 'net/http' url = URI("https://www.descarcagratis.com/api/1/movie/1?api_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) request["cache-control"] = 'no-cache' response = http.request(request) puts response.read_body
import requests url = "https://www.descarcagratis.com/api/1/movie/1" querystring = {"api_token":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"} headers = { 'cache-control': "no-cache", } response = requests.request("GET", url, headers=headers, params=querystring) print(response.text)
var settings = { "async": true, "crossDomain": true, "url": "https://www.descarcagratis.com/api/1/movie/1?api_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "method": "GET", "headers": { "cache-control": "no-cache", } } $.ajax(settings).done(function (response) { console.log(response); });
var http = require("https"); var options = { "method": "GET", "hostname": "www.descarcagratis.com", "port": null, "path": "/api/1/movie/1?api_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "headers": { "cache-control": "no-cache", } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://www.descarcagratis.com/api/1/movie/1?api_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("cache-control", "no-cache") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
Seriale
Colectie
GET/api/1/serial?api_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&page={page_number}
Acest endpoint este folosit pentru a lista intreaga colectie de seriale
Resursa
GET/api/1/serial/{serial_id}?api_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Acest endpoint este folosit pentru a lista resursa unui serial
curl -X GET \ 'https://www.descarcagratis.com/api/1/serial/1?api_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \ -H 'cache-control: no-cache' \
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://www.descarcagratis.com/api/1/serial/1?api_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "cache-control: no-cache", ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
require 'uri' require 'net/http' url = URI("https://www.descarcagratis.com/api/1/serial/1?api_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) request["cache-control"] = 'no-cache' response = http.request(request) puts response.read_body
import requests url = "https://www.descarcagratis.com/api/1/serial/1" querystring = {"api_token":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"} headers = { 'cache-control': "no-cache", } response = requests.request("GET", url, headers=headers, params=querystring) print(response.text)
var settings = { "async": true, "crossDomain": true, "url": "https://www.descarcagratis.com/api/1/serial/1?api_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "method": "GET", "headers": { "cache-control": "no-cache", } } $.ajax(settings).done(function (response) { console.log(response); });
var http = require("https"); var options = { "method": "GET", "hostname": "www.descarcagratis.com", "port": null, "path": "/api/1/serial/1?api_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "headers": { "cache-control": "no-cache", } }; var req = http.request(options, function (res) { var chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { var body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end();
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://www.descarcagratis.com/api/1/serial/1?api_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("cache-control", "no-cache") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
Raspuns - application/json
Acest raspuns ofera utilizatorului intreaga resursa/colectie cand cererea este indeplinita cu succs.
Este intors ca tip de data un obiect.
Acest raspuns este intors pentru ca autentificarea a esuat.
Va rugam sa verificati API Token aferent contului.
Acest raspuns este intors pentru ca resursa/colectia nu a fost gasita.
Va rugam sa verificati cererea.
Acest raspuns este intors daca sunt trimise mai multe de 60 de cereri/minut.
Va rugam sa incercati dupa 1 minut.