### GET Request Example (with Date Range)
Source: https://developer.yahoo.co.jp/webapi/shopping/downloadShopCategories.html
Example of a GET request to download categories within a specified date range. Requires a Host header and an Authorization Bearer token.
```HTTP
GET /ShoppingWebService/V1/downloadShopCategories?seller_id=teststore&since=20130101&until=20130131 HTTP/1.1
Host: circus.shopping.yahooapis.jp
Authorization: Bearer <アクセストークン>
```
--------------------------------
### Sample Request for Download Execution API
Source: https://developer.yahoo.co.jp/webapi/shopping/downloadSubmit.html
This is an example of an HTTP GET request to the Download Execution API for retrieving product data. Include your authorization token for access.
```http
GET /ShoppingWebService/V1/downloadSubmit?seller_id=teststore&type=1 HTTP/1.1
Host: circus.shopping.yahooapis.jp
Authorization: Bearer <アクセストークン>
```
--------------------------------
### GET Request Example (Post-2015 Date Change)
Source: https://developer.yahoo.co.jp/webapi/shopping/downloadShopCategories.html
Example of a GET request to download categories after October 1, 2015. Only the seller_id is required for basic requests.
```HTTP
GET /ShoppingWebService/V1/downloadShopCategories?seller_id=teststore HTTP/1.1
Host: circus.shopping.yahooapis.jp
Authorization: Bearer <アクセストークン>
```
--------------------------------
### Sample GET Request for Download List
Source: https://developer.yahoo.co.jp/webapi/shopping/downloadList.html
This is an example of a GET request to the Download List API. It includes the Host header and an Authorization header with a bearer token for authentication.
```http
GET /ShoppingWebService/V1/downloadList?seller_id=teststore&type=1 HTTP/1.1
Host: circus.shopping.yahooapis.jp
Authorization: Bearer <アクセストークン>
```
--------------------------------
### Example: What can I do?
Source: https://developer.yahoo.co.jp/webapi/jlp/nlu/v2/api.html
This example shows how to query for available actions. The response includes the input text, the recognized method, and status information.
```json
{
"result": {
"INTEXT": "何ができる",
"METHOD": "help",
"STATUS": "200",
"VAR_INTEXT_TIMESTAMP": "1521534816",
"VAR_TEST_BTSC": "36"
}
}
```
--------------------------------
### Sample Request URL for Download List
Source: https://developer.yahoo.co.jp/webapi/shopping/downloadList.html
Use this URL to request a list of product data files that are ready for download. Ensure you replace 'teststore' with your actual seller ID.
```url
https://circus.shopping.yahooapis.jp/ShoppingWebService/V1/downloadList?seller_id=teststore&type=1
```
--------------------------------
### Sample HTTP Request for Get Item API
Source: https://developer.yahoo.co.jp/webapi/shopping/getItem.html
This is an example of an HTTP GET request to the Get Item API. Include your authorization token in the 'Authorization' header.
```http
GET /ShoppingWebService/V1/getItem?seller_id=teststore&item_code=item1 HTTP/1.1
Host: circus.shopping.yahooapis.jp
Authorization: Bearer <アクセストークン>
```
--------------------------------
### Sample GET Request for GetCustomPageDesign API
Source: https://developer.yahoo.co.jp/webapi/shopping/getCustomPageDesign.html
This is an example of a GET request to the GetCustomPageDesign API. It includes the Host header and an Authorization header with an access token.
```HTTP
GET /ShoppingWebService/V1/getCustomPageDesign?seller_id=test-store&page_key=custom01
HTTP/1.1
Host: circus.shopping.yahooapis.jp
Authorization: Bearer <アクセストークン>
```
--------------------------------
### Example: Search for "Toge-ari Toge-nashi Toge-toge"
Source: https://developer.yahoo.co.jp/webapi/jlp/nlu/v2/api.html
This example demonstrates a search query. The response includes the input text, the recognized method, and the extracted query parameter.
```json
{
"result": {
"INTEXT": "トゲアリトゲナシトゲトゲを検索",
"METHOD": "search",
"PARAM_QUERY": "トゲアリトゲナシトゲトゲ",
"STATUS": "200",
"VAR_INTEXT_TIMESTAMP": "1521535181",
"VAR_TEST_BTSC": "41"
}
}
```
--------------------------------
### HTTP GET Request for Category Tree
Source: https://developer.yahoo.co.jp/webapi/shopping/getShopCategory.html
Example of an HTTP GET request to retrieve the category tree. Ensure you include a valid Authorization header with your access token.
```http
GET /ShoppingWebService/V1/getShopCategory?seller_id=teststore&category_code=13457 HTTP/1.1
Host: circus.shopping.yahooapis.jp
Authorization: Bearer <アクセストークン>
```
--------------------------------
### Sample GET Request for Preview HTML API
Source: https://developer.yahoo.co.jp/webapi/shopping/getPreviewHtml.html
This sample demonstrates a GET request to the Preview HTML Reference API. It includes the Host header and an Authorization header for authentication. Replace '<アクセストークン>' with your actual access token.
```http
GET /ShoppingWebService/V1/getPreviewHtml?seller_id=test-store HTTP/1.1
Host: circus.shopping.yahooapis.jp
Authorization: Bearer <アクセストークン>
```
--------------------------------
### Address Search Request Example
Source: https://developer.yahoo.co.jp/webapi/map/openlocalplatform/v1/geocoder.html
Example of a GET request to search for an address. Ensure your Client ID is included and the query is properly URL-encoded. The maximum URL length is 2048 bytes.
```http
https://map.yahooapis.jp/geocode/V1/geoCoder?appid=<あなたのClient ID(アプリケーションID)>&query=%e6%9d%b1%e4%ba%ac%e9%83%bd%e6%b8%af%e5%8c%ba%e5%85%ad%e6%9c%a8
```
--------------------------------
### Sample Request URL for Download Execution API
Source: https://developer.yahoo.co.jp/webapi/shopping/downloadSubmit.html
Use this URL to initiate a download request for product data. Ensure you replace 'teststore' with your actual seller ID.
```http
https://circus.shopping.yahooapis.jp/ShoppingWebService/V1/downloadSubmit?seller_id=teststore&type=1
```
--------------------------------
### XML Vertex Information
Source: https://developer.yahoo.co.jp/webapi/map/openlocalplatform/v1/ydf/reference.html
Example of Vertex structure in XML format, representing start and end points of a route segment with station details.
```xml
Start
中目黒
22855
End
横浜
23368
```
--------------------------------
### Initialize ItemSearchListModule with ValueCommerce Affiliate Parameters
Source: https://developer.yahoo.co.jp/webapi/shopping/sample/sample6.html
Set up the ItemSearchListModule for ValueCommerce affiliate links by providing 'appid', 'query', 'affiliate_type' as 'vc', and the ValueCommerce 'affiliate_id' URL. The 'hits' parameter limits the displayed results.
```php
new ItemSearchListModule(array(
"appid" => "<あなたのClient ID(アプリケーションID)>",
"query" => "スニーカー",
"affiliate_type"=>"vc",
"affiliate_id" =>"http://ck.jp.ap.valuecommerce.com/servlet/referral?sid=2219441&pid=874350257&vc_url=",
"hits" => 3
));
```
--------------------------------
### JSON Vertex Information
Source: https://developer.yahoo.co.jp/webapi/map/openlocalplatform/v1/ydf/reference.html
Example of Vertex structure in JSON format, representing start and end points of a route segment with station details.
```json
"Vertex":[
{"Type":"Start","Property":{"Station":{"Name":"\u4e2d\u76ee\u9ed2","Code":"22855"}}},
{"Type":"End","Property":{"Station":{"Name":"\u6a2a\u6d5c","Code":"23368"}}}
]
```
--------------------------------
### Initialize ItemSearchListModule with ValueCommerce Affiliate
Source: https://developer.yahoo.co.jp/webapi/shopping/sample/sample6.html
Instantiate the `ItemSearchListModule` class with search parameters for ValueCommerce affiliate. Ensure you replace `<あなたのClient ID(アプリケーションID)>` with your actual Client ID and provide the correct ValueCommerce affiliate URL.
```php
new ItemSearchListModule(array(
"appid" => "<あなたのClient ID(アプリケーションID)>",
"query" => "スニーカー",
"affiliate_type"=>"vc",
"affiliate_id" =>"http://ck.jp.ap.valuecommerce.com/servlet/referral?sid=2219441&pid=874350257&vc_url=",
"hits" => 3
));
```
--------------------------------
### Sample Response (With Warnings)
Source: https://developer.yahoo.co.jp/webapi/shopping/editItem.html
This XML response indicates a successful operation ('OK') but includes warnings. The save process still executes even with warnings. Warnings detail issues like removed external links or unclosed tags.
```xml
OK
additional1
it-00001
外部リンクを削除しました。
additional1
it-00002
商品説明はタグ閉じされていません。
```
--------------------------------
### Sample Request URL for Custom Page List API
Source: https://developer.yahoo.co.jp/webapi/shopping/getCustomPageList.html
Example of a GET request URL for the Custom Page List API, including the seller_id parameter.
```URL
https://circus.shopping.yahooapis.jp/ShoppingWebService/V1/getCustomPageList?seller_id=test-store
```
--------------------------------
### ItemSearchFormModule Configuration Example
Source: https://developer.yahoo.co.jp/webapi/shopping/sample/sample5.html
This example shows how to configure the ItemSearchFormModule with various parameters such as 'appid', 'query', 'category_id', 'affiliate_type', 'affiliate_id', and 'sort'. Ensure you replace placeholder values with your actual credentials and desired search terms.
```php
$obj = new ItemSearchFormModule(array(
"appid" => Client ID(アプリケーションID) //必須,
"query" => 検索キーワード //必須,
"category_id" => カテゴリIDによる商品の絞り込み検索, //任意
"affiliate_type"=>"アフィリエイトタイプ yid or vc",
"affiliate_id" =>"アリフィリエイトIDを指定します",
"sort" => "ソート順を指定します"
));
```
--------------------------------
### SHP Brand Search API Sample HTTP Request
Source: https://developer.yahoo.co.jp/webapi/shopping/getShopBrandList.html
An example HTTP GET request for the SHP Brand Search API, including Host and Authorization headers.
```http
GET /ShoppingWebService/V1/getShopBrandList?seller_id=teststore&query=Apple&type=name&sort=%2Bjtitle&start=1&results=25 HTTP/1.1
Host: circus.shopping.yahooapis.jp
Authorization: Bearer <アクセストークン>
```
--------------------------------
### Sample Request (With Individual Product Details)
Source: https://developer.yahoo.co.jp/webapi/shopping/editItem.html
This sample shows a POST request to edit an item, including detailed options, subcodes, and subcode images. Remember to URL-encode parameters when making the actual request. The 'options' parameter uses a specific format for defining attributes like color and size.
```http
POST /ShoppingWebService/V1/editItem HTTP/1.1
Host: circus.shopping.yahooapis.jp
Authorization: Bearer <アクセストークン>
seller_id=teststore&item_code=960977-002&path=Tops&name=T-Shirts&product_category=44087&price=2345&options='色:10011#ネイビー:58106, グレー:10684|サイズ:24181#S:210762,M:210763'&subcodes='色:ネイビー#サイズ:S=subcodetest-1|色:ネイビー#サイズ:M=subcodetest-2|色:グレー#サイズ:S=subcodetest-3|色:グレー#サイズ:M=subcodetest-4'&subcode_images='{"subcodetest-1":{"urls":["https://shopping.c.yimg.jp/lib/test-store/image.jpeg"],"main_flag":1},"subcodetest-2":{"urls":["https://shopping.c.yimg.jp/lib/test-store/image2.jpeg"],"main_flag":0}}'
```
--------------------------------
### ResultInfo XML Output
Source: https://developer.yahoo.co.jp/webapi/map/openlocalplatform/v1/ydf/reference.html
Example of the ResultInfo element in XML format, providing API response metadata. It includes count, total records, start position, latency, status, and a description.
```xml
10
78
1
0.021
200
Yahoo!グルメが提供する全国の飲食店情報
```
--------------------------------
### Sample HTTP Request for Custom Page List API
Source: https://developer.yahoo.co.jp/webapi/shopping/getCustomPageList.html
This is an example of an HTTP GET request to the Custom Page List API. Ensure you include a valid Authorization header with your access token.
```HTTP
GET /ShoppingWebService/V1/getCustomPageList?seller_id=test-store HTTP/1.1
Host:circus.shopping.yahooapis.jp
Authorization: Bearer <アクセストークン>
```
--------------------------------
### Display Product List with Predefined Settings
Source: https://developer.yahoo.co.jp/webapi/shopping/sample
Utilize the Product Search API to display a product list based on pre-set keywords or other criteria. This sample shows how to fetch and display a list.
```JavaScript
const displayProductList = async (keyword, sortOrder) => {
const endpoint = 'https://shopping.yahooapis.jp/ShoppingWebApi/v1/itemSearch';
const params = {
appid: 'YOUR_APP_ID',
query: keyword,
sort: sortOrder,
results: 20
};
try {
const response = await fetch(`${endpoint}?${new URLSearchParams(params)}`);
const data = await response.json();
// Process and display the product list
console.log('Product list:', data.hits);
return data.hits;
} catch (error) {
console.error('Error displaying product list:', error);
return [];
}
};
// Example usage:
displayProductList('smartphone', '-price').then(products => {
// Render products on the page
});
```
--------------------------------
### Product Registration API Sample (PHP)
Source: https://developer.yahoo.co.jp/webapi/shopping/item
Sample code for making a request to the Product Registration API. Ensure you have the necessary setup for PHP HTTP requests.
```php
'YOUR_APPID', // アプリケーションID
'product_name' => '商品名', // 商品名
'price' => 1000, // 価格
'stock' => 10, // 在庫数
// その他のパラメータ...
);
// GETリクエストを構築
$query_string = http_build_query($params);
$request_url = $api_url . '?' . $query_string;
// cURLを使用してAPIにリクエストを送信
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $request_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
if (curl_errno($ch)) {
echo 'cURL Error: ' . curl_error($ch);
} else {
// APIレスポンスを処理
$xml = simplexml_load_string($response);
if ($xml === false) {
echo 'XML Parsing Error';
} else {
// 商品登録成功時の処理
if ((string)$xml->Result->Code == 200) {
echo '商品が正常に登録されました。';
} else {
echo '商品登録に失敗しました。エラーコード: ' . $xml->Result->Code . ', エラーメッセージ: ' . $xml->Result->Message;
}
}
}
c_url_close($ch);
?>
```
--------------------------------
### GET /getStoreinfoFreespace
Source: https://developer.yahoo.co.jp/webapi/shopping/getStoreinfoFreespace.html
Retrieves the free space information for a store. This API allows you to fetch custom content areas within your store settings, such as company profiles, privacy policies, and shopping guides.
```APIDOC
## GET /getStoreinfoFreespace
### Description
Retrieves the free space information for a store. This API allows you to fetch custom content areas within your store settings, such as company profiles, privacy policies, and shopping guides.
### Method
GET
### Endpoint
https://circus.shopping.yahooapis.jp/ShoppingWebService/V1/getStoreinfoFreespace
### Parameters
#### Query Parameters
- **seller_id** (string) - Required - Specifies the store account.
### Request Example
```
https://circus.shopping.yahooapis.jp/ShoppingWebService/V1/getStoreinfoFreespace?seller_id=test-store
```
### Response
#### Success Response (200)
- **/ResultSet** (object) - Contains all query responses.
- **/ResultSet/Result** (object) - The result of the query.
- **/ResultSet/Result/Info** (object) - Company profile information.
- **/ResultSet/Result/Info/FreeSpace1** (string) - Supplementary free space for company profile information (HTML allowed).
- **/ResultSet/Result/Info/FreeSpace2** (string) - Supplementary free space for contact information (HTML allowed).
- **/ResultSet/Result/PrivacyPolicy** (object) - Privacy policy information.
- **/ResultSet/Result/PrivacyPolicy/FreeSpace1** (string) - Supplementary free space for privacy policy (HTML allowed).
- **/ResultSet/Result/Guide** (object) - Shopping guide information.
- **/ResultSet/Result/Guide/FreeSpace1** (string) - Supplementary free space for payment information (HTML allowed).
- **/ResultSet/Result/Guide/FreeSpace2** (string) - Supplementary free space for delivery information (HTML allowed).
- **/ResultSet/Result/Guide/FreeSpace3** (string) - Supplementary free space for sales terms (HTML allowed).
- **/ResultSet/Result/Guide/FreeSpace4** (string) - Supplementary free space for returns, exchanges, and warranty information (HTML allowed).
#### Response Example
```xml
会社概要ストア情報補足フリースペース1]]>
会社概要お問い合せ情報補足フリースペース2]]>
プライバシーポリシー補足フリースペース1]]>
お支払い補足フリースペース1]]>
お届け補足フリースペース1]]>
販売条件補足フリースペース1]]>
返品、交換、保証補足フリースペース1]]>
```
### Error Handling
- **ed-00000** (404) - Page not found.
- **ed-00001** (500) - System error occurred.
- **ed-00002** (503) - Server is under maintenance.
- **ed-00003** (400) - Store account not specified.
- **ed-00004** (400) - Store account does not exist.
- **ed-00005** (400) - Invalid store account specified.
```
--------------------------------
### Sample HTTP Request for Publish History Summary API
Source: https://developer.yahoo.co.jp/webapi/shopping/publishHistorySummary.html
This is an example of an HTTP GET request to the Publish History Summary API. Ensure you include the correct Host and Authorization header with your access token.
```HTTP
GET /ShoppingWebService/V1/publishHistorySummary?seller_id=teststore&start=1&results=25&sort=%2Bpublish_user HTTP/1.1
Host: circus.shopping.yahooapis.jp
Authorization: Bearer <アクセストークン>
```
--------------------------------
### Sample Response: OK Status with Warnings
Source: https://developer.yahoo.co.jp/webapi/shopping/setStoreinfoFreespace.html
This sample XML response shows a successful operation ('OK' status) but includes warnings. The save process is still executed.
```xml
OK
info_free_space1
ds-09004
外部リンクを削除しました。
info_free_space2
ds-09007
外部リンクを削除しました。
```
--------------------------------
### Sample Request URL for Preview HTML API
Source: https://developer.yahoo.co.jp/webapi/shopping/getPreviewHtml.html
This is a sample URL to access the Preview HTML Reference API. Ensure you replace 'test-store' with your actual seller ID.
```http
https://circus.shopping.yahooapis.jp/ShoppingWebService/V1/getPreviewHtml?seller_id=test-store
```
--------------------------------
### Sample Request URL for SHP Category Search
Source: https://developer.yahoo.co.jp/webapi/shopping/getShopCategoryList.html
Example of a GET request URL for searching Yahoo! Shopping categories. Includes required parameters like seller_id and query, and an optional category code.
```text
https://circus.shopping.yahooapis.jp/ShoppingWebService/V1/getShopCategoryList?seller_id=teststore&query=PC&category=13457
```
--------------------------------
### Sample XML Response for Download List
Source: https://developer.yahoo.co.jp/webapi/shopping/downloadList.html
This XML response shows a list of files ready for download. It includes the total number of available results, returned results, and details for each result such as file type, name, and creation time.
```xml
1
data.csv
2013-02-07T18:00:00+09:00
2
quantity.csv
2013-02-07T18:00:00+09:00
```