Download an image or template in a format
curl --request GET \
--url https://api.magnific.com/v2/stock/resources/{resource_id}/download/{resource_format} \
--header 'x-magnific-api-key: <api-key>'import requests
url = "https://api.magnific.com/v2/stock/resources/{resource_id}/download/{resource_format}"
headers = {"x-magnific-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-magnific-api-key': '<api-key>'}};
fetch('https://api.magnific.com/v2/stock/resources/{resource_id}/download/{resource_format}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.magnific.com/v2/stock/resources/{resource_id}/download/{resource_format}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-magnific-api-key: <api-key>"
],
]);
$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.magnific.com/v2/stock/resources/{resource_id}/download/{resource_format}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-magnific-api-key", "<api-key>")
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.magnific.com/v2/stock/resources/{resource_id}/download/{resource_format}")
.header("x-magnific-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.magnific.com/v2/stock/resources/{resource_id}/download/{resource_format}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-magnific-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"signed_url": "https://img.b2bpic.net/premium-photo/close-up-cat-resting_1048944-9269194.jpg?t=st=1725276607~exp=1725280207~hmac=1538f1b294fc3a19a19e9f02ceeb6594a9a1e36a900de85d47bbd386e27dddbe",
"filename": "blackboard-template.zip",
"url": "https://downloadscdn5.magnific.com/d/1137445/blackboard-template.zip"
}
]
}{
"code": "validation_failed",
"message": "<string>",
"details": {
"errors": {}
},
"request_id": "<string>"
}{
"code": "validation_failed",
"message": "<string>",
"details": {
"errors": {}
},
"request_id": "<string>"
}{
"code": "validation_failed",
"message": "<string>",
"details": {
"errors": {}
},
"request_id": "<string>"
}{
"code": "validation_failed",
"message": "<string>",
"details": {
"errors": {}
},
"request_id": "<string>"
}{
"code": "validation_failed",
"message": "<string>",
"details": {
"errors": {}
},
"request_id": "<string>"
}{
"code": "validation_failed",
"message": "<string>",
"details": {
"errors": {}
},
"request_id": "<string>"
}{
"code": "validation_failed",
"message": "<string>",
"details": {
"errors": {}
},
"request_id": "<string>"
}{
"code": "validation_failed",
"message": "<string>",
"details": {
"errors": {}
},
"request_id": "<string>"
}{
"code": "validation_failed",
"message": "<string>",
"details": {
"errors": {}
},
"request_id": "<string>"
}Images and templates API
Download an image or template in a format
A download URL for one format of an image or template (a PSD, an AI, an EPS…). It spends credits.
GET
/
v2
/
stock
/
resources
/
{resource_id}
/
download
/
{resource_format}
Download an image or template in a format
curl --request GET \
--url https://api.magnific.com/v2/stock/resources/{resource_id}/download/{resource_format} \
--header 'x-magnific-api-key: <api-key>'import requests
url = "https://api.magnific.com/v2/stock/resources/{resource_id}/download/{resource_format}"
headers = {"x-magnific-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-magnific-api-key': '<api-key>'}};
fetch('https://api.magnific.com/v2/stock/resources/{resource_id}/download/{resource_format}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.magnific.com/v2/stock/resources/{resource_id}/download/{resource_format}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-magnific-api-key: <api-key>"
],
]);
$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.magnific.com/v2/stock/resources/{resource_id}/download/{resource_format}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-magnific-api-key", "<api-key>")
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.magnific.com/v2/stock/resources/{resource_id}/download/{resource_format}")
.header("x-magnific-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.magnific.com/v2/stock/resources/{resource_id}/download/{resource_format}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-magnific-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"signed_url": "https://img.b2bpic.net/premium-photo/close-up-cat-resting_1048944-9269194.jpg?t=st=1725276607~exp=1725280207~hmac=1538f1b294fc3a19a19e9f02ceeb6594a9a1e36a900de85d47bbd386e27dddbe",
"filename": "blackboard-template.zip",
"url": "https://downloadscdn5.magnific.com/d/1137445/blackboard-template.zip"
}
]
}{
"code": "validation_failed",
"message": "<string>",
"details": {
"errors": {}
},
"request_id": "<string>"
}{
"code": "validation_failed",
"message": "<string>",
"details": {
"errors": {}
},
"request_id": "<string>"
}{
"code": "validation_failed",
"message": "<string>",
"details": {
"errors": {}
},
"request_id": "<string>"
}{
"code": "validation_failed",
"message": "<string>",
"details": {
"errors": {}
},
"request_id": "<string>"
}{
"code": "validation_failed",
"message": "<string>",
"details": {
"errors": {}
},
"request_id": "<string>"
}{
"code": "validation_failed",
"message": "<string>",
"details": {
"errors": {}
},
"request_id": "<string>"
}{
"code": "validation_failed",
"message": "<string>",
"details": {
"errors": {}
},
"request_id": "<string>"
}{
"code": "validation_failed",
"message": "<string>",
"details": {
"errors": {}
},
"request_id": "<string>"
}{
"code": "validation_failed",
"message": "<string>",
"details": {
"errors": {}
},
"request_id": "<string>"
}Authorizations
magnificApiKeybearerAuth
Your Magnific API key. Learn how to obtain an API key
Path Parameters
Was this page helpful?