Products
Analyze a product
Get product informations from an url
POST
/
analyze
cURL
curl --request POST \
--url https://api.stoaty.com/analyze \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "http://…",
"nocache": false,
"currency": "USD",
"country": "US"
}
'import requests
url = "https://api.stoaty.com/analyze"
payload = {
"url": "http://…",
"nocache": False,
"currency": "USD",
"country": "US"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: 'http://…', nocache: false, currency: 'USD', country: 'US'})
};
fetch('https://api.stoaty.com/analyze', 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.stoaty.com/analyze",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => 'http://…',
'nocache' => false,
'currency' => 'USD',
'country' => 'US'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.stoaty.com/analyze"
payload := strings.NewReader("{\n \"url\": \"http://…\",\n \"nocache\": false,\n \"currency\": \"USD\",\n \"country\": \"US\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.stoaty.com/analyze")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"http://…\",\n \"nocache\": false,\n \"currency\": \"USD\",\n \"country\": \"US\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.stoaty.com/analyze")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"http://…\",\n \"nocache\": false,\n \"currency\": \"USD\",\n \"country\": \"US\"\n}"
response = http.request(request)
puts response.read_body{
"product": {
"name": "Macbook Air M2",
"description": "An Apple laptop",
"canonical": "https://…",
"images": [
"https://…",
"https://…"
],
"price": 1199.99,
"originalPrice": 1299.9,
"currency": "USD",
"originalCurrency": "EUR",
"available": true,
"sku": "9278451",
"brand": "Apple",
"color": "Black",
"size": "13 inches"
},
"metadata": {
"success": true,
"tokens": {
"consumed": 1,
"remaining": 13489
},
"cached": false,
"executionTime": 1120
}
}"invalid_type: url: Required"Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Configuration for the analysis
The url of the product to analyze
Example:
"http://…"
Disable the abilit to pull the informations from the cache, consume token
The currency symbol (ISO 4217) you want the price converted to
Example:
"USD"
The country code (ISO 3166-1 alpha-2) you want to request the website from (does not work for all domains)
Example:
"US"
Was this page helpful?
⌘I
cURL
curl --request POST \
--url https://api.stoaty.com/analyze \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "http://…",
"nocache": false,
"currency": "USD",
"country": "US"
}
'import requests
url = "https://api.stoaty.com/analyze"
payload = {
"url": "http://…",
"nocache": False,
"currency": "USD",
"country": "US"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: 'http://…', nocache: false, currency: 'USD', country: 'US'})
};
fetch('https://api.stoaty.com/analyze', 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.stoaty.com/analyze",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => 'http://…',
'nocache' => false,
'currency' => 'USD',
'country' => 'US'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.stoaty.com/analyze"
payload := strings.NewReader("{\n \"url\": \"http://…\",\n \"nocache\": false,\n \"currency\": \"USD\",\n \"country\": \"US\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.stoaty.com/analyze")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"http://…\",\n \"nocache\": false,\n \"currency\": \"USD\",\n \"country\": \"US\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.stoaty.com/analyze")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"http://…\",\n \"nocache\": false,\n \"currency\": \"USD\",\n \"country\": \"US\"\n}"
response = http.request(request)
puts response.read_body{
"product": {
"name": "Macbook Air M2",
"description": "An Apple laptop",
"canonical": "https://…",
"images": [
"https://…",
"https://…"
],
"price": 1199.99,
"originalPrice": 1299.9,
"currency": "USD",
"originalCurrency": "EUR",
"available": true,
"sku": "9278451",
"brand": "Apple",
"color": "Black",
"size": "13 inches"
},
"metadata": {
"success": true,
"tokens": {
"consumed": 1,
"remaining": 13489
},
"cached": false,
"executionTime": 1120
}
}"invalid_type: url: Required"