Search products
curl --request GET \
--url https://api.example.com/v1/products/search \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/v1/products/search"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/v1/products/search', 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.example.com/v1/products/search",
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.example.com/v1/products/search"
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.example.com/v1/products/search")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/products/search")
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{
"object": "search_result",
"has_more": true,
"data": [
{
"id": "prod_1Q2w3E4r",
"object": "product",
"livemode": true,
"created": 123,
"status": "active",
"sku": "<string>",
"updated": 123,
"title": "<string>",
"description": "<string>",
"variant_of": "<string>",
"options": {},
"category": "<string>",
"brand": "<string>",
"material": "<string>",
"origin_country": "<string>",
"manufacturer": {
"name": "<string>",
"country": "<string>",
"mid": "<string>"
},
"unit_value": {
"amount": 123,
"currency": "usd"
},
"unit_net_weight": {
"value": 123,
"unit": "g"
},
"unit_gross_weight": {
"value": 123,
"unit": "g"
},
"unit_dimensions": {
"length": 123,
"width": 123,
"height": 123,
"unit": "mm"
},
"hs_codes": {
"export": {},
"import": {}
},
"classification": {
"source": "<string>",
"reviewed": true,
"reviewed_at": 123
},
"compliance": {
"controlled": true,
"control_type": "dual_use",
"eccn": "<string>",
"license": {
"type": "export",
"number": "<string>",
"expires_on": "2023-12-25"
},
"regulatory_agency": "<string>",
"regulatory_program": "<string>",
"regulatory_category_code": "<string>",
"certification": {
"type": "<string>",
"reference": "<string>"
}
},
"dangerous_goods": {
"class": "<string>",
"un_number": "<string>",
"proper_shipping_name": "<string>",
"packing_group": "I",
"packing_instruction": "<string>",
"section": "<string>",
"quantity": {
"value": 123,
"unit": "g"
},
"lithium": {
"type": "ion",
"configuration": "alone",
"watt_hours": 123,
"lithium_grams": 123,
"cells": 123
},
"accessibility": "accessible",
"transport_mode": "air",
"excepted_quantity": true,
"limited_quantity": true,
"emergency_contact": {
"name": "<string>",
"phone": "<string>"
},
"declaration_document": "<string>"
},
"barcodes": [
{
"type": "<string>",
"value": "<string>"
}
],
"product_url": "<string>",
"image_url": "<string>",
"external_ids": [
{
"source": "<string>",
"id": "<string>"
}
],
"restrictions": [
{
"country": "<string>",
"level": "prohibited",
"agency": "<string>",
"code": "<string>",
"message": "<string>",
"license_types": [
"<string>"
],
"documents_required": [
"<string>"
]
}
],
"version": 123,
"user_metadata": {},
"carrier_metadata": {},
"system_metadata": {
"source": "api",
"created_by": {
"type": "api_key",
"id": "<string>"
},
"request_id": "<string>",
"idempotency_key": "<string>",
"batch": "<string>",
"generated": true,
"test_scenario": "<string>"
}
}
],
"next_page": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"carrier": {
"id": "<string>",
"connection": "<string>",
"code": "<string>",
"message": "<string>"
},
"shipment": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"param": "<string>"
}
]
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"carrier": {
"id": "<string>",
"connection": "<string>",
"code": "<string>",
"message": "<string>"
},
"shipment": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"param": "<string>"
}
]
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"carrier": {
"id": "<string>",
"connection": "<string>",
"code": "<string>",
"message": "<string>"
},
"shipment": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"param": "<string>"
}
]
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"carrier": {
"id": "<string>",
"connection": "<string>",
"code": "<string>",
"message": "<string>"
},
"shipment": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"param": "<string>"
}
]
}
}Products
Search products
GET
/
v1
/
products
/
search
Search products
curl --request GET \
--url https://api.example.com/v1/products/search \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/v1/products/search"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/v1/products/search', 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.example.com/v1/products/search",
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.example.com/v1/products/search"
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.example.com/v1/products/search")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/products/search")
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{
"object": "search_result",
"has_more": true,
"data": [
{
"id": "prod_1Q2w3E4r",
"object": "product",
"livemode": true,
"created": 123,
"status": "active",
"sku": "<string>",
"updated": 123,
"title": "<string>",
"description": "<string>",
"variant_of": "<string>",
"options": {},
"category": "<string>",
"brand": "<string>",
"material": "<string>",
"origin_country": "<string>",
"manufacturer": {
"name": "<string>",
"country": "<string>",
"mid": "<string>"
},
"unit_value": {
"amount": 123,
"currency": "usd"
},
"unit_net_weight": {
"value": 123,
"unit": "g"
},
"unit_gross_weight": {
"value": 123,
"unit": "g"
},
"unit_dimensions": {
"length": 123,
"width": 123,
"height": 123,
"unit": "mm"
},
"hs_codes": {
"export": {},
"import": {}
},
"classification": {
"source": "<string>",
"reviewed": true,
"reviewed_at": 123
},
"compliance": {
"controlled": true,
"control_type": "dual_use",
"eccn": "<string>",
"license": {
"type": "export",
"number": "<string>",
"expires_on": "2023-12-25"
},
"regulatory_agency": "<string>",
"regulatory_program": "<string>",
"regulatory_category_code": "<string>",
"certification": {
"type": "<string>",
"reference": "<string>"
}
},
"dangerous_goods": {
"class": "<string>",
"un_number": "<string>",
"proper_shipping_name": "<string>",
"packing_group": "I",
"packing_instruction": "<string>",
"section": "<string>",
"quantity": {
"value": 123,
"unit": "g"
},
"lithium": {
"type": "ion",
"configuration": "alone",
"watt_hours": 123,
"lithium_grams": 123,
"cells": 123
},
"accessibility": "accessible",
"transport_mode": "air",
"excepted_quantity": true,
"limited_quantity": true,
"emergency_contact": {
"name": "<string>",
"phone": "<string>"
},
"declaration_document": "<string>"
},
"barcodes": [
{
"type": "<string>",
"value": "<string>"
}
],
"product_url": "<string>",
"image_url": "<string>",
"external_ids": [
{
"source": "<string>",
"id": "<string>"
}
],
"restrictions": [
{
"country": "<string>",
"level": "prohibited",
"agency": "<string>",
"code": "<string>",
"message": "<string>",
"license_types": [
"<string>"
],
"documents_required": [
"<string>"
]
}
],
"version": 123,
"user_metadata": {},
"carrier_metadata": {},
"system_metadata": {
"source": "api",
"created_by": {
"type": "api_key",
"id": "<string>"
},
"request_id": "<string>",
"idempotency_key": "<string>",
"batch": "<string>",
"generated": true,
"test_scenario": "<string>"
}
}
],
"next_page": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"carrier": {
"id": "<string>",
"connection": "<string>",
"code": "<string>",
"message": "<string>"
},
"shipment": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"param": "<string>"
}
]
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"carrier": {
"id": "<string>",
"connection": "<string>",
"code": "<string>",
"message": "<string>"
},
"shipment": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"param": "<string>"
}
]
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"carrier": {
"id": "<string>",
"connection": "<string>",
"code": "<string>",
"message": "<string>"
},
"shipment": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"param": "<string>"
}
]
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"request_id": "<string>",
"carrier": {
"id": "<string>",
"connection": "<string>",
"code": "<string>",
"message": "<string>"
},
"shipment": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"param": "<string>"
}
]
}
}Authorizations
apiKeyoauth2
sk_test_ / sk_live_ / rk_test_ / rk_live_ keys
Headers
Act on behalf of a connected account (acct_...)
Query Parameters
Search query language (chapter 10 §3)
Required range:
1 <= x <= 100