Wyszukiwanie produktów
Wyniki wyszukiwania w kategorii Zakupy (produktów) w formacie JSON.
GET /v1/shoppingWymaga prawidłowego klucza API, aktywnego członkostwa i dostępnych środków na API.
| Nazwa | Typ | Wymagany | Domyślnie | Opis |
|---|---|---|---|---|
q |
string | tak | — | Zapytanie wyszukiwania (produkt lub kategoria). |
safe |
string | nie | on |
Poziom bezpiecznego wyszukiwania: off lub on. |
gl |
string | nie | (automatycznie) | Dwuliterowy kod regionu/kraju (np. us, gb) – wpływa na ceny i sprzedawców. |
hl |
string | nie | (automatycznie) | Dwuliterowy kod języka (np. en, es). |
time |
string | nie | any |
Filtr aktualności: any, hour, day, week, month, year. |
num |
integer | nie | (domyślnie dla usługi) | Żądana liczba wyników. Ograniczona do zakresu 5–100 (poza zakresem → 20). |
{
"query": "wireless headphones",
"kind": "shopping",
"results": [
{
"title": "Acme Wireless Headphones",
"url": "https://shop.example.com/p/acme-wh",
"description": "Over-ear, 40-hour battery…",
"thumbnail": "https://shop.example.com/p/acme-wh/thumb.jpg",
"price": "$129.99",
"meta": "Example Store",
"extra": null
}
]
}| Pole | Typ | Opis |
|---|---|---|
query |
string | Wykonane zapytanie. |
kind |
string | W tym punkcie końcowym zawsze shopping. |
results[].title |
string | Nazwa produktu. |
results[].url |
string | Adres URL strony produktu. |
results[].description |
string | null | Opis produktu, jeśli jest dostępny. |
results[].thumbnail |
string | null | Adres URL zdjęcia produktu. |
results[].price |
string | null | Sformatowana cena, jeśli jest dostępna. |
results[].meta |
string | null | Sprzedawca / źródło. |
results[].extra |
string | null | Zwykle nieużywane w przypadku zakupów. |
curl -G "https://api.suede.io/v1/shopping" \
-H "Authorization: Bearer $SUEDE_API_KEY" \
--data-urlencode "q=wireless headphones" \
--data-urlencode "gl=us"using var http = new HttpClient();
http.DefaultRequestHeaders.Authorization =
new("Bearer", Environment.GetEnvironmentVariable("SUEDE_API_KEY"));
var url = "https://api.suede.io/v1/shopping?q=" + Uri.EscapeDataString("wireless headphones") + "&gl=us";
Console.WriteLine(await http.GetStringAsync(url));const params = new URLSearchParams({ q: "wireless headphones", gl: "us" });
const res = await fetch(`https://api.suede.io/v1/shopping?${params}`, {
headers: { Authorization: `Bearer ${process.env.SUEDE_API_KEY}` },
});
const data = await res.json();
for (const r of data.results) console.log(`${r.title}: ${r.price} (${r.meta})`);