Find Similar Media
curl --request GET \
--url https://api.dreep.cloud/api/v1/media/{mediaId}/similar \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.dreep.cloud/api/v1/media/{mediaId}/similar"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.dreep.cloud/api/v1/media/{mediaId}/similar', 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.dreep.cloud/api/v1/media/{mediaId}/similar",
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.dreep.cloud/api/v1/media/{mediaId}/similar"
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.dreep.cloud/api/v1/media/{mediaId}/similar")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dreep.cloud/api/v1/media/{mediaId}/similar")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"assets": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"filename": "red-sneaker.jpg",
"url": "https://cdn.dreep.cloud/api/v1/fetch/2f928a3f-1d2a-4a2b",
"type": "image/jpeg",
"sizeBytes": "56696",
"assetType": "image",
"folder": "products",
"folderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"tags": [
"sneaker",
"red"
],
"score": 0.31
}
]
}{
"error": true,
"message": "Invalid request parameters",
"code": "invalid_request"
}{
"error": true,
"message": "Invalid request parameters",
"code": "invalid_request"
}Image Search
Find Similar Media
The project’s indexed images that look most like this one, best first. The image itself isn’t returned. The image must be indexed first. Finding similar images is free; indexing is charged per image.
GET
/
api
/
v1
/
media
/
{mediaId}
/
similar
Find Similar Media
curl --request GET \
--url https://api.dreep.cloud/api/v1/media/{mediaId}/similar \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.dreep.cloud/api/v1/media/{mediaId}/similar"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.dreep.cloud/api/v1/media/{mediaId}/similar', 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.dreep.cloud/api/v1/media/{mediaId}/similar",
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.dreep.cloud/api/v1/media/{mediaId}/similar"
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.dreep.cloud/api/v1/media/{mediaId}/similar")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dreep.cloud/api/v1/media/{mediaId}/similar")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"assets": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"filename": "red-sneaker.jpg",
"url": "https://cdn.dreep.cloud/api/v1/fetch/2f928a3f-1d2a-4a2b",
"type": "image/jpeg",
"sizeBytes": "56696",
"assetType": "image",
"folder": "products",
"folderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"tags": [
"sneaker",
"red"
],
"score": 0.31
}
]
}{
"error": true,
"message": "Invalid request parameters",
"code": "invalid_request"
}{
"error": true,
"message": "Invalid request parameters",
"code": "invalid_request"
}Returns the project’s indexed images that look most like this one, best first.
The image itself isn’t included. The image must be
indexed first.
Finding similar images is free. Indexing is charged per image.
Similar images usually score 0.8 and up. See
Results and scores.
curl "https://api.dreep.cloud/api/v1/media/2f928a3f-1d2a-4a2b/similar?limit=8&minScore=0.8" \
-H "Authorization: Bearer drp_live_xxxxx"