Infer Enrichment
curl --request POST \
--url https://catalogapi.rastro.ai/api/public/infer-enrichment \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>",
"items": [
{}
]
}
'import requests
url = "https://catalogapi.rastro.ai/api/public/infer-enrichment"
payload = {
"prompt": "<string>",
"items": [{}]
}
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({prompt: '<string>', items: [{}]})
};
fetch('https://catalogapi.rastro.ai/api/public/infer-enrichment', 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://catalogapi.rastro.ai/api/public/infer-enrichment",
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([
'prompt' => '<string>',
'items' => [
[
]
]
]),
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://catalogapi.rastro.ai/api/public/infer-enrichment"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"items\": [\n {}\n ]\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://catalogapi.rastro.ai/api/public/infer-enrichment")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"items\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://catalogapi.rastro.ai/api/public/infer-enrichment")
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 \"prompt\": \"<string>\",\n \"items\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"suggested_schema": {},
"suggested_taxonomy": {},
"web_enrichment_fields": [
{
"name": "<string>",
"description": "<string>",
"type": "string",
"array_element_type": "<string>",
"unit": "<string>",
"enum": [
"<string>"
],
"items_enum": [
"<string>"
],
"sample_values": [
"<string>"
],
"required": true,
"merge": true,
"pattern": "<string>",
"pattern_message": "<string>",
"min_length": 123,
"max_length": 123,
"minimum": 123,
"maximum": 123,
"unique": true,
"semantic_type": "<string>"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Enrich
Infer Enrichment
Analyze sample data and infer schema, taxonomy, and web enrichment fields.
Pass sample items and a description, get back:
- suggested_schema: JSON Schema ready for catalog creation
- suggested_taxonomy: Taxonomy ready for catalog creation
- web_enrichment_fields: Fields to use with /public/enrich endpoint
Example request:
{
"prompt": "Audio products catalog - headphones and earbuds",
"items": [
{"name": "Sony WH-1000XM5", "sku": "WH1000XM5-B", "price": "$399.99"},
{"name": "Apple AirPods Pro 2", "sku": "AIRPODS-PRO-2", "price": "$249.00"}
]
}
POST
/
public
/
infer-enrichment
Infer Enrichment
curl --request POST \
--url https://catalogapi.rastro.ai/api/public/infer-enrichment \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>",
"items": [
{}
]
}
'import requests
url = "https://catalogapi.rastro.ai/api/public/infer-enrichment"
payload = {
"prompt": "<string>",
"items": [{}]
}
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({prompt: '<string>', items: [{}]})
};
fetch('https://catalogapi.rastro.ai/api/public/infer-enrichment', 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://catalogapi.rastro.ai/api/public/infer-enrichment",
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([
'prompt' => '<string>',
'items' => [
[
]
]
]),
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://catalogapi.rastro.ai/api/public/infer-enrichment"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"items\": [\n {}\n ]\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://catalogapi.rastro.ai/api/public/infer-enrichment")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"items\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://catalogapi.rastro.ai/api/public/infer-enrichment")
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 \"prompt\": \"<string>\",\n \"items\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"suggested_schema": {},
"suggested_taxonomy": {},
"web_enrichment_fields": [
{
"name": "<string>",
"description": "<string>",
"type": "string",
"array_element_type": "<string>",
"unit": "<string>",
"enum": [
"<string>"
],
"items_enum": [
"<string>"
],
"sample_values": [
"<string>"
],
"required": true,
"merge": true,
"pattern": "<string>",
"pattern_message": "<string>",
"min_length": 123,
"max_length": 123,
"minimum": 123,
"maximum": 123,
"unique": true,
"semantic_type": "<string>"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Body
application/json
Response
Successful Response
Response with inferred schema, taxonomy, and web enrichment fields.