Home/Code examples

For Developers

Code examples
Call the API in a few lines

Design samples in many languages — add your API Key and use real endpoints from the docs

For Developers

Easy to connect with REST API

JSON responses work with any HTTP-capable language — pick a language on the left, then paste your API Key

  • item_search

    Search products by keyword

  • item_get

    Fetch details, price, SKU, images

  • item_search_img

    Search by image

  • item_password

    Convert share links / 淘口令

  • shop_get

    Fetch shop information

  • seller_info

    Seller / supplier information

examples/item_search.php

PHPREST · JSON
<?php
// Design sample — see real endpoints in the docs
$params = http_build_query([
  'key'  => 'YOUR_API_KEY',
  'q'    => 'backpack',
  'lang' => 'en',
]);
$url = "https://api.example.com/taobao/item_search?" . $params;
$res = file_get_contents($url);
$data = json_decode($res, true);
foreach ($data['items'] as $item) {
  echo $item['title'] . ' – ¥' . $item['price'] . PHP_EOL;
}

Design samples — host api.example.com is a placeholder; real endpoints are in the docs · supports 15 languages