{
    "info": {
        "_postman_id": "4ed0194f-bcae-45c2-995a-a42e22108b5c",
        "name": "Taobao API",
        "description": "Taobao API provides access to up-to-date product data from the Chinese marketplace, including prices, descriptions, images, specifications, variants, seller information, and other details. It is suitable for integrating Taobao with online stores, marketplaces, and other e-commerce services.\n\n## Authentication\n\nPass your API key in the `X-Api-Key` header.\n\nIf a secret is enabled for the key, every request must also be signed with two headers:\n\n- `X-Api-Timestamp` — current Unix timestamp in seconds;\n- `X-Api-Sign` — `HMAC-SHA256(X-Api-Key + secret + X-Api-Timestamp + path_with_query, secret)` as lowercase hex, where `path_with_query` is the URL-encoded request path with the query string, e.g. `/v1/api/{uuid}/items?page=1`.\n\n## Postman\n\n1. Import the collection and the environment.\n2. Select the environment in the top right corner of Postman.\n3. Fill in `apiKey`, and `apiSecret` if a secret is enabled for the key.\n\nThe collection pre-request script calculates `X-Api-Timestamp` and `X-Api-Sign` right before each request is sent, only when `apiSecret` is set; otherwise these headers are removed. The calculated values are not shown in the request Headers tab and are not included in Postman code snippets: check them in the Postman Console (View → Show Postman Console).",
        "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
    },
    "auth": {
        "type": "apikey",
        "apikey": [
            {
                "key": "key",
                "value": "X-Api-Key",
                "type": "string"
            },
            {
                "key": "value",
                "value": "{{apiKey}}",
                "type": "string"
            },
            {
                "key": "in",
                "value": "header",
                "type": "string"
            }
        ]
    },
    "event": [
        {
            "listen": "prerequest",
            "script": {
                "type": "text/javascript",
                "exec": [
                    "// Request signing, applied only when the apiSecret variable is set:",
                    "// X-Api-Sign = HMAC-SHA256(apiKey + apiSecret + X-Api-Timestamp + pathWithQuery, apiSecret), lowercase hex.",
                    "// pathWithQuery must be URL-encoded exactly as Postman sends it, so path/query are encoded like postman-url-encoder does.",
                    "// Results are logged to the Postman Console (View > Show Postman Console).",
                    "const cryptoJs = require('crypto-js');",
                    "const postmanSdk = require('postman-collection');",
                    "",
                    "const apiKey = String(pm.variables.get('apiKey') || '');",
                    "const apiSecret = String(pm.variables.get('apiSecret') || '');",
                    "",
                    "if (apiKey === '') {",
                    "    console.warn('X-Api-Key is empty: select the environment (top right corner) and set apiKey.');",
                    "}",
                    "",
                    "if (apiSecret === '') {",
                    "    pm.request.headers.remove('X-Api-Timestamp');",
                    "    pm.request.headers.remove('X-Api-Sign');",
                    "    console.info('Request signing skipped: apiSecret is empty. Set apiSecret in the selected environment if a secret is enabled for the key.');",
                    "} else {",
                    "    const PATH_RESERVED = ' \"#<>?`{}';",
                    "    const QUERY_KEY_RESERVED = ' \"#&\\'<>=';",
                    "    const QUERY_VALUE_RESERVED = ' \"#&\\'<>';",
                    "    const encode = (value, reserved) => Array.from(String(value)).map((char) => {",
                    "        const code = char.charCodeAt(0);",
                    "        if (code > 0x7e) {",
                    "            return encodeURIComponent(char);",
                    "        }",
                    "        if (code <= 0x20 || reserved.includes(char)) {",
                    "            return '%' + code.toString(16).toUpperCase().padStart(2, '0');",
                    "        }",
                    "        return char;",
                    "    }).join('');",
                    "",
                    "    // url.toString() substitutes path variables the same way Postman does when sending:",
                    "    // empty ones stay in the URL as \":name\" and must be signed as is.",
                    "    const url = new postmanSdk.Url(pm.variables.replaceIn(pm.request.url.toString()));",
                    "    const path = '/' + (url.path || []).map((segment) => {",
                    "        if (segment.startsWith(':') && pm.request.url.variables.has(segment.slice(1))) {",
                    "            console.warn(`Path variable ${segment} is empty, the request is sent to \"${segment}\" literally.`);",
                    "        }",
                    "        return encode(segment, PATH_RESERVED);",
                    "    }).join('/');",
                    "    const query = (url.query ? url.query.all() : [])",
                    "        .filter((param) => !param.disabled && param.key !== null && param.key !== undefined)",
                    "        .map((param) => (param.value === null || param.value === undefined",
                    "            ? encode(param.key, QUERY_KEY_RESERVED)",
                    "            : encode(param.key, QUERY_KEY_RESERVED) + '=' + encode(param.value, QUERY_VALUE_RESERVED)))",
                    "        .join('&');",
                    "",
                    "    const timestamp = Math.floor(Date.now() / 1000).toString();",
                    "    const pathWithQuery = query !== '' ? path + '?' + query : path;",
                    "    const sign = cryptoJs.HmacSHA256(apiKey + apiSecret + timestamp + pathWithQuery, apiSecret).toString(cryptoJs.enc.Hex);",
                    "",
                    "    pm.variables.set('apiTimestamp', timestamp);",
                    "    pm.variables.set('apiSign', sign);",
                    "    pm.request.headers.upsert({key: 'X-Api-Timestamp', value: timestamp});",
                    "    pm.request.headers.upsert({key: 'X-Api-Sign', value: sign});",
                    "    console.info('Request signed', {'X-Api-Timestamp': timestamp, 'X-Api-Sign': sign, pathWithQuery});",
                    "}"
                ]
            }
        }
    ],
    "variable": [
        {
            "key": "baseUrl",
            "value": "https://gw.setalabs.com/v1/api/4ed0194f-bcae-45c2-995a-a42e22108b5c",
            "type": "string"
        },
        {
            "key": "apiKey",
            "value": "",
            "type": "string"
        },
        {
            "key": "apiSecret",
            "value": "",
            "type": "string"
        }
    ],
    "item": [
        {
            "name": "Get Taobao Category Tree",
            "request": {
                "method": "GET",
                "header": [
                    {
                        "key": "Accept",
                        "value": "application/json",
                        "type": "text"
                    },
                    {
                        "key": "X-Api-Timestamp",
                        "value": "{{apiTimestamp}}",
                        "type": "text",
                        "description": "Calculated by the collection pre-request script when apiSecret is set (see Postman Console); removed otherwise."
                    },
                    {
                        "key": "X-Api-Sign",
                        "value": "{{apiSign}}",
                        "type": "text",
                        "description": "Calculated by the collection pre-request script when apiSecret is set (see Postman Console); removed otherwise."
                    }
                ],
                "url": {
                    "raw": "{{baseUrl}}/catalog",
                    "host": [
                        "{{baseUrl}}"
                    ],
                    "path": [
                        "catalog"
                    ],
                    "query": [
                        {
                            "key": "language",
                            "value": "en",
                            "description": "The language in which the API response data will be returned.",
                            "type": "text",
                            "disabled": true
                        }
                    ]
                },
                "description": "Returns the complete hierarchy of Taobao product categories, including parent categories and subcategories."
            },
            "response": []
        },
        {
            "name": "Get Supported Languages",
            "request": {
                "method": "GET",
                "header": [
                    {
                        "key": "Accept",
                        "value": "application/json",
                        "type": "text"
                    },
                    {
                        "key": "X-Api-Timestamp",
                        "value": "{{apiTimestamp}}",
                        "type": "text",
                        "description": "Calculated by the collection pre-request script when apiSecret is set (see Postman Console); removed otherwise."
                    },
                    {
                        "key": "X-Api-Sign",
                        "value": "{{apiSign}}",
                        "type": "text",
                        "description": "Calculated by the collection pre-request script when apiSecret is set (see Postman Console); removed otherwise."
                    }
                ],
                "url": {
                    "raw": "{{baseUrl}}/langs",
                    "host": [
                        "{{baseUrl}}"
                    ],
                    "path": [
                        "langs"
                    ]
                },
                "description": "Returns the list of languages supported by the Taobao API. Use a language code from this list as the language parameter to specify the response language."
            },
            "response": []
        },
        {
            "name": "Get Taobao Product Details",
            "request": {
                "method": "GET",
                "header": [
                    {
                        "key": "Accept",
                        "value": "application/json",
                        "type": "text"
                    },
                    {
                        "key": "X-Api-Timestamp",
                        "value": "{{apiTimestamp}}",
                        "type": "text",
                        "description": "Calculated by the collection pre-request script when apiSecret is set (see Postman Console); removed otherwise."
                    },
                    {
                        "key": "X-Api-Sign",
                        "value": "{{apiSign}}",
                        "type": "text",
                        "description": "Calculated by the collection pre-request script when apiSecret is set (see Postman Console); removed otherwise."
                    }
                ],
                "url": {
                    "raw": "{{baseUrl}}/product/:id",
                    "host": [
                        "{{baseUrl}}"
                    ],
                    "path": [
                        "product",
                        ":id"
                    ],
                    "query": [
                        {
                            "key": "language",
                            "value": "en",
                            "description": "The language in which the API response data will be returned.",
                            "type": "text",
                            "disabled": true
                        }
                    ],
                    "variable": [
                        {
                            "key": "id",
                            "value": "",
                            "description": ""
                        }
                    ]
                },
                "description": "Returns detailed information about a Taobao product by its ID, including seller information, SKU variants and attributes, and the product description."
            },
            "response": []
        },
        {
            "name": "Get Product Reviews",
            "request": {
                "method": "GET",
                "header": [
                    {
                        "key": "Accept",
                        "value": "application/json",
                        "type": "text"
                    },
                    {
                        "key": "X-Api-Timestamp",
                        "value": "{{apiTimestamp}}",
                        "type": "text",
                        "description": "Calculated by the collection pre-request script when apiSecret is set (see Postman Console); removed otherwise."
                    },
                    {
                        "key": "X-Api-Sign",
                        "value": "{{apiSign}}",
                        "type": "text",
                        "description": "Calculated by the collection pre-request script when apiSecret is set (see Postman Console); removed otherwise."
                    }
                ],
                "url": {
                    "raw": "{{baseUrl}}/reviews/:id",
                    "host": [
                        "{{baseUrl}}"
                    ],
                    "path": [
                        "reviews",
                        ":id"
                    ],
                    "query": [
                        {
                            "key": "language",
                            "value": "en",
                            "description": "The language in which the API response data will be returned.",
                            "type": "text",
                            "disabled": true
                        }
                    ],
                    "variable": [
                        {
                            "key": "id",
                            "value": "",
                            "description": ""
                        }
                    ]
                },
                "description": "Returns customer reviews for a Taobao or Tmall product by its ID."
            },
            "response": []
        },
        {
            "name": "Search Taobao Products",
            "request": {
                "method": "GET",
                "header": [
                    {
                        "key": "Accept",
                        "value": "application/json",
                        "type": "text"
                    },
                    {
                        "key": "X-Api-Timestamp",
                        "value": "{{apiTimestamp}}",
                        "type": "text",
                        "description": "Calculated by the collection pre-request script when apiSecret is set (see Postman Console); removed otherwise."
                    },
                    {
                        "key": "X-Api-Sign",
                        "value": "{{apiSign}}",
                        "type": "text",
                        "description": "Calculated by the collection pre-request script when apiSecret is set (see Postman Console); removed otherwise."
                    }
                ],
                "url": {
                    "raw": "{{baseUrl}}/search?page=1&limit=24",
                    "host": [
                        "{{baseUrl}}"
                    ],
                    "path": [
                        "search"
                    ],
                    "query": [
                        {
                            "key": "category_id",
                            "value": "",
                            "description": "Filters products by category ID.",
                            "type": "text",
                            "disabled": true
                        },
                        {
                            "key": "text",
                            "value": "",
                            "description": "Search query used to find matching products.",
                            "type": "text",
                            "disabled": true
                        },
                        {
                            "key": "vendor_name",
                            "value": "",
                            "description": "Filters products by seller name.",
                            "type": "text",
                            "disabled": true
                        },
                        {
                            "key": "price_min",
                            "value": "",
                            "description": "Minimum product price.",
                            "type": "text",
                            "disabled": true
                        },
                        {
                            "key": "price_max",
                            "value": "",
                            "description": "Maximum product price.",
                            "type": "text",
                            "disabled": true
                        },
                        {
                            "key": "volume_min",
                            "value": "",
                            "description": "Minimum product sales volume.",
                            "type": "text",
                            "disabled": true
                        },
                        {
                            "key": "volume_max",
                            "value": "",
                            "description": "Maximum product sales volume.",
                            "type": "text",
                            "disabled": true
                        },
                        {
                            "key": "sort",
                            "value": "",
                            "description": "Sort order for the search results. Available values: default, price, -price, total_price, -total_price, volume, -volume, vendor_rating, -vendor_rating, updated_time, -updated_time. Prefix a value with - to sort in descending order.",
                            "type": "text",
                            "disabled": true
                        },
                        {
                            "key": "page",
                            "value": "1",
                            "description": "(required) Page number of the search results to retrieve.",
                            "type": "text"
                        },
                        {
                            "key": "limit",
                            "value": "24",
                            "description": "(required) Number of products to return per page.",
                            "type": "text"
                        },
                        {
                            "key": "language",
                            "value": "en",
                            "description": "The language in which the API response data will be returned.",
                            "type": "text",
                            "disabled": true
                        }
                    ]
                },
                "description": "Searches for products on Taobao and returns matching results based on the specified search parameters."
            },
            "response": []
        },
        {
            "name": "Search Products by Image",
            "request": {
                "method": "GET",
                "header": [
                    {
                        "key": "Accept",
                        "value": "application/json",
                        "type": "text"
                    },
                    {
                        "key": "X-Api-Timestamp",
                        "value": "{{apiTimestamp}}",
                        "type": "text",
                        "description": "Calculated by the collection pre-request script when apiSecret is set (see Postman Console); removed otherwise."
                    },
                    {
                        "key": "X-Api-Sign",
                        "value": "{{apiSign}}",
                        "type": "text",
                        "description": "Calculated by the collection pre-request script when apiSecret is set (see Postman Console); removed otherwise."
                    }
                ],
                "url": {
                    "raw": "{{baseUrl}}/search_img?image_url=&page=1&limit=24",
                    "host": [
                        "{{baseUrl}}"
                    ],
                    "path": [
                        "search_img"
                    ],
                    "query": [
                        {
                            "key": "language",
                            "value": "en",
                            "description": "The language in which the API response data will be returned.",
                            "type": "text",
                            "disabled": true
                        },
                        {
                            "key": "image_url",
                            "value": "",
                            "description": "(required) URL of the image used to find visually similar products.",
                            "type": "text"
                        },
                        {
                            "key": "page",
                            "value": "1",
                            "description": "(required) Page number of the search results to retrieve.",
                            "type": "text"
                        },
                        {
                            "key": "limit",
                            "value": "24",
                            "description": "(required) integer (query) Number of requested elements from the entire list.",
                            "type": "text"
                        }
                    ]
                },
                "description": "Searches for visually similar products on Taobao and Tmall using the provided image."
            },
            "response": []
        },
        {
            "name": "Get Taobao Seller Details",
            "request": {
                "method": "GET",
                "header": [
                    {
                        "key": "Accept",
                        "value": "application/json",
                        "type": "text"
                    },
                    {
                        "key": "X-Api-Timestamp",
                        "value": "{{apiTimestamp}}",
                        "type": "text",
                        "description": "Calculated by the collection pre-request script when apiSecret is set (see Postman Console); removed otherwise."
                    },
                    {
                        "key": "X-Api-Sign",
                        "value": "{{apiSign}}",
                        "type": "text",
                        "description": "Calculated by the collection pre-request script when apiSecret is set (see Postman Console); removed otherwise."
                    }
                ],
                "url": {
                    "raw": "{{baseUrl}}/seller/:id",
                    "host": [
                        "{{baseUrl}}"
                    ],
                    "path": [
                        "seller",
                        ":id"
                    ],
                    "query": [
                        {
                            "key": "language",
                            "value": "en",
                            "description": "The language in which the API response data will be returned.",
                            "type": "text",
                            "disabled": true
                        }
                    ],
                    "variable": [
                        {
                            "key": "id",
                            "value": "",
                            "description": ""
                        }
                    ]
                },
                "description": "Returns detailed information about a Taobao seller by their ID."
            },
            "response": []
        }
    ]
}