PHP "In-depth explanation" Taobao product details data interface acquisition method, Taobao API application guide

The method of obtaining Taobao product details data is as follows:

  • Determine the monitoring object, which is usually a competing product that is similar to the product in your own store. Obtain the product details by obtaining the product ID from the URL of the Taobao product details page.
  • Obtain product details data through the API interface, apply for a developer account and obtain authorized access, and write code according to the documentation of the API interface.
  • Use crawler tools to capture data, but you need to pay attention to comply with the relevant regulations of the Taobao platform and do not capture data too frequently, otherwise your IP may be blocked.

After obtaining the product details data, you need to analyze the data to understand the market dynamics of competing products, optimize the data, and improve your competitiveness. At the same time, you can also compare the data with your own store's data to find optimization points and improvement directions.

Taobao product details data parameters are spliced ​​into the URL in HTTP, GET, PSOT, including the following types1:

  • key : calling key must be spliced ​​into the URL in GET mode.
  • secret : calling key.
  • api_name : API interface name, included in the request address^[item_search, item_get, item_search_shop, etc.].
  • cache : The cached data will be called, which is faster. The default is yes.
  • result_type : Return data format, the default is json.
  • lang : Translation language, the default is cn simplified Chinese.
  • version : API version.

Taobao.item_get-Get product details data return value description

1.Public parameters

name type must describe
key String yes Call key (must be spliced ​​into the URL in GET mode, demo example address)
secret String yes call key
api_name String yes API interface name (included in the request address) [item_search, item_get, item_search_shop, etc.]
cache String no [yes,no] The default is yes, which will call cached data and is faster.
result_type String no [json,jsonu,xml,serialize,var_export] returns the data format, the default is json, the content output by jsonu can be read directly in Chinese
lang String no [cn,en,ru] translation language, default cn simplified Chinese
version String no API version (copy Taobaoapi2014 to get the API SDK file)

2. Request Example (Php)

<?php

// 请求示例 url 默认请求参数已经URL编码处理
// 本示例代码未加密secret参数明文传输,若要加密请参考:https://open.xxxxx.cn/help/demo/sdk/demo-sign.php
$method = "GET";
$url = "https://api-gw.xxxxx.cn/taobao/item_get/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&num_iid=652874751412&is_promotion=1";
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST,FALSE);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER,FALSE);
curl_setopt($curl, CURLOPT_FAILONERROR, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, true);
curl_setopt($curl, CURLOPT_ENCODING, "gzip");
var_dump(curl_exec($curl));
?>

 The purpose of Taobao product details data interface is as follows:

  1. Monitor competitive product data. By obtaining the product details of competing products, you can understand the information and sales of competing products and provide reference for your own product design and marketing strategies.
  2. Integrate into your own website or app. By obtaining product details data, you can integrate the data into your own website or application to provide consumers with a more comprehensive and convenient shopping experience.
  3. Analyze market dynamics. By analyzing a large amount of product detail data, you can understand the overall situation and trends of the market and provide a basis for your own business decisions.
  4. Available to third-party developers. Other developers can use Taobao's product details data interface to develop various applications and plug-ins to provide consumers and merchants with more convenience and services.

I hope the above examples can help friends in need.

Guess you like

Origin blog.csdn.net/G171104/article/details/132322309