请求地址: https://api-gw.onebound.cn/micro/item_search_shop
请求参数:userid=1785418864&page=&sort=&
参数说明: userid:shop_id page:页码 sort:sort=1 销量 sort=0 综合 sort=5 价格 降序
Version: Date:
-- 请求示例 url 默认请求参数已经URL编码处理 curl -i "https://api-gw.onebound.cn/micro/item_search_shop/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&userid=1785418864&page=&sort=&"
<?php // 请求示例 url 默认请求参数已经URL编码处理 // 本示例代码未加密secret参数明文传输,若要加密请参考:https://open.onebound.cn/help/demo/sdk/demo-sign.php $method = "GET"; $url = "https://api-gw.onebound.cn/micro/item_search_shop/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&userid=1785418864&page=&sort=&"; $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)); ?>
<?php //定义缓存目录和引入文件 define("DIR_RUNTIME","runtime/"); define("DIR_ERROR","runtime/"); define("SECACHE_SIZE","0"); //SDK下载地址 https://open.onebound.cn/help/demo/sdk/onebound-api-sdk.zip include ("ObApiClient.php"); $obapi = new otao\ObApiClient(); $obapi->api_url = "http://api-gw.onebound.cn/"; $obapi->api_urls = array("http://api-gw.onebound.cn/","http://api-1.onebound.cn/");//备用API服务器 $obapi->api_urls_on = true;//当网络错误时,是否启用备用API服务器 $obapi->api_key = "<您自己的apiKey>"; $obapi->api_secret = "<您自己的apiSecret>"; $obapi->api_version =""; $obapi->secache_path ="runtime/"; $obapi->secache_time ="86400"; $obapi->cache = true; $api_data = $obapi->exec( array( "api_type" =>"micro", "api_name" =>"item_search_shop", "api_params"=>array ( 'userid' => '1785418864', 'page' => '', 'sort' => '', ) ) ); var_dump($api_data); ?>
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.net.URL; import java.nio.charset.Charset; import org.json.JSONException; import org.json.JSONObject; import java.io.PrintWriter; import java.net.URLConnection; public class Example { private static String readAll(Reader rd) throws IOException { StringBuilder sb = new StringBuilder(); int cp; while ((cp = rd.read()) != -1) { sb.append((char) cp); } return sb.toString(); } public static JSONObject postRequestFromUrl(String url, String body) throws IOException, JSONException { URL realUrl = new URL(url); URLConnection conn = realUrl.openConnection(); conn.setDoOutput(true); conn.setDoInput(true); PrintWriter out = new PrintWriter(conn.getOutputStream()); out.print(body); out.flush(); InputStream instream = conn.getInputStream(); try { BufferedReader rd = new BufferedReader(new InputStreamReader(instream, Charset.forName("UTF-8"))); String jsonText = readAll(rd); JSONObject json = new JSONObject(jsonText); return json; } finally { instream.close(); } } public static JSONObject getRequestFromUrl(String url) throws IOException, JSONException { URL realUrl = new URL(url); URLConnection conn = realUrl.openConnection(); InputStream instream = conn.getInputStream(); try { BufferedReader rd = new BufferedReader(new InputStreamReader(instream, Charset.forName("UTF-8"))); String jsonText = readAll(rd); JSONObject json = new JSONObject(jsonText); return json; } finally { instream.close(); } } public static void main(String[] args) throws IOException, JSONException { // 请求示例 url 默认请求参数已经URL编码处理 String url = "https://api-gw.onebound.cn/micro/item_search_shop/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&userid=1785418864&page=&sort=&"; JSONObject json = getRequestFromUrl(url); System.out.println(json.toString()); } }
//using System.Net.Security; //using System.Security.Cryptography.X509Certificates; private const String method = "GET"; static void Main(string[] args) { String bodys = ""; // 请求示例 url 默认请求参数已经做URL编码 String url = "https://api-gw.onebound.cn/micro/item_search_shop/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&userid=1785418864&page=&sort=&"; HttpWebRequest httpRequest = null; HttpWebResponse httpResponse = null; if (url.Contains("https://")) { ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult); httpRequest = (HttpWebRequest)WebRequest.CreateDefault(new Uri(url)); } else { httpRequest = (HttpWebRequest)WebRequest.Create(url); } httpRequest.Method = method; if (0 < bodys.Length) { byte[] data = Encoding.UTF8.GetBytes(bodys); using (Stream stream = httpRequest.GetRequestStream()) { stream.Write(data, 0, data.Length); } } try { httpResponse = (HttpWebResponse)httpRequest.GetResponse(); } catch (WebException ex) { httpResponse = (HttpWebResponse)ex.Response; } Console.WriteLine(httpResponse.StatusCode); Console.WriteLine(httpResponse.Method); Console.WriteLine(httpResponse.Headers); Stream st = httpResponse.GetResponseStream(); StreamReader reader = new StreamReader(st, Encoding.GetEncoding("utf-8")); Console.WriteLine(reader.ReadToEnd()); Console.WriteLine("\n"); } public static bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors) { return true; }
# coding:utf-8 """ Compatible for python2.x and python3.x requirement: pip install requests """ from __future__ import print_function import requests # 请求示例 url 默认请求参数已经做URL编码 url = "https://api-gw.onebound.cn/micro/item_search_shop/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&userid=1785418864&page=&sort=&" headers = { "Accept-Encoding": "gzip", "Connection": "close" } if __name__ == "__main__": r = requests.get(url, headers=headers) json_obj = r.json() print(json_obj)
url := fmt.Sprintf("https://api-gw.onebound.cn/micro/item_search_shop/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&userid=1785418864&page=&sort=&", params) req, err := http.NewRequest("GET", url, nil) if err != nil { panic(err) } req.Header.Set("Authorization", apiKey) client := &http.Client{} resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) if err != nil { panic(err) } fmt.Println(string(body))
fetch('https://api-gw.onebound.cn/micro/item_search_shop/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({"userid":"1785418864","page":"","sort":""})// request parameters here }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error(error));
<script src="js/obapi.js"></script> <script type="text/javascript"> obAPI.config({ debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 api_url: "https://api-gw.onebound.cn", // api_key: "<您自己的apiKey>", // 必填, api_secret: "<您自己的apiSecret>", // lang: "cn", // timestamp: "", // 必填,生成签名的时间戳 nonceStr: "", // 必填,生成签名的随机串 signature: "",// 必填,签名 jsApiList: [] // 必填,需要使用的JS接口列表 }); </script> <div id="api_data_box"></div> <script type="text/javascript"> obAPI.exec( { "api_type":"micro", "api_name" : "item_search_shop", "api_params": {"userid":"1785418864","page":"","sort":""}//userid=1785418864&page=&sort=&,#具体参数请参考文档说明 }, function(e){ document.querySelector("#api_data_box").innerHTML=JSON.stringify(e) } ); </script>
require "net/http" require "uri" url = URI("https://api-gw.onebound.cn/micro/item_search_shop/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&userid=1785418864&page=&sort=&") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body
import Foundation let url = URL(string: "https://api-gw.onebound.cn/micro/item_search_shop/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&userid=1785418864&page=&sort=&")! let task = URLSession.shared.dataTask(with: url) { data, response, error in guard let data = data else { print("Error: No data was returned") return } if let data = String(data: data, encoding: .utf8) { print(data) } } task.resume()
NSURL *myUrl = [NSURL URLWithString:@"https://api-gw.onebound.cn/micro/item_search_shop/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&userid=1785418864&page=&sort=&"]; NSMutableURLRequest *request=[NSMutableURLRequest requestWithURL:myUrl cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:60.0]; [request setHTTPMethod:@"GET"]; NSError *error; NSURLResponse *response; NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; NSString *result = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; NSLog(@"%@",result);
#include<stdio.h> #include <stdlib.h> #include<string.h> #include<curl/curl.h> int main(){ CURL *curl; CURLcode res; struct curl_slist *headers=NULL; char url[] = "https://api-gw.onebound.cn/micro/item_search_shop/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&userid=1785418864&page=&sort=&"; curl_global_init(CURL_GLOBAL_ALL); curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL,url); headers = curl_slist_append(headers, "Content-Type: application/json"); curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); res = curl_easy_perform(curl); if(res != CURLE_OK){ printf("curl_easy_perform(): %s\n",curl_easy_strerror(res)); } curl_easy_cleanup(curl); } curl_global_cleanup(); return 0; }
#include<iostream> #include<string> #include<curl/curl.h> using namespace std; static size_t Data(void *ptr, size_t size, size_t nmemb, string *stream) { std::size_t realSize = size *nmemb; auto *realPtr = reinterpret_cast<char *>(ptr); for (std::size_t i=0;i<realSize;++i) { *(stream) += *(realPtr + i); } return realSize; } int main(){ CURL *curl; CURLcode result; string readBuffer; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "https://api-gw.onebound.cn/micro/item_search_shop/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&userid=1785418864&page=&sort=&"); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, Data); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer); result = curl_easy_perform(curl); if(result == CURLE_OK) { cout<<readBuffer<<endl; }else{ cerr<<"curl_easy error:"<<curl_easy_strerror(result)<<endl; } curl_easy_cleanup(curl); } return 0; }
const https = require("https"); https.get("https://api-gw.onebound.cn/micro/item_search_shop/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&userid=1785418864&page=&sort=&", (resp) => { let data = ""; resp.on("data", (chunk) => { data += chunk; }); resp.on("end", () => { console.log(data); }); }).on("error", (err) => { console.log("Error: " + err.message); });
import java.net.HttpURLConnection import java.net.URL fun main() { val url = URL("https://api-gw.onebound.cn/micro/item_search_shop/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&userid=1785418864&page=&sort=&") val con = url.openConnection() as HttpURLConnection con.requestMethod = "GET" val responseCode = con.responseCode if (responseCode == HttpURLConnection.HTTP_OK) { // success val inputLine = con.inputStream.bufferedReader().use { it.readText() } println(inputLine) } else { println("GET request failed") } }
use std::io::{self, Read}; use reqwest; fn main() -> io::Result<()> { let mut resp = reqwest::get("https://api-gw.onebound.cn/micro/item_search_shop/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&userid=1785418864&page=&sort=&")?; let mut content = String::new(); resp.read_to_string(&mut content)?; println!("{}", content); Ok(()) }
library(httr) r <- GET("https://api-gw.onebound.cn/micro/item_search_shop/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&userid=1785418864&page=&sort=&") content(r)
url = "https://api-gw.onebound.cn/micro/item_search_shop/?key=<您自己的apiKey>&secret=<您自己的apiSecret>&userid=1785418864&page=&sort=&"; response = webread(url); disp(response);
{ "items": { "userid": "1785418864", "page": 1, "page_size": 20, "real_total_results": 2000, "total_results": 2000, "pagecount": 100, "data_from": "micro", "item": [ { "title": "包装服务 详情询客服", "num_iid": "4244475449", "price": 1, "orginal_price": 1, "promotion_price": 1, "pic_url": "https://si.geilicdn.com/wdseller1447298905-08b40000017663b607c20a21348d-unadjust_900_1200.jpeg", "sales": 408, "seller_id": "1785418864", "seller_nick": "", "detail_url": "https://weidian.com/item.html?itemID=4244475449" }, { "title": "出口日本 薄绒加厚奥利绒发热休闲裤女士", "num_iid": "4162863529", "price": 320, "orginal_price": 320, "promotion_price": 320, "pic_url": "https://si.geilicdn.com/wdseller1447298905-5f7500000175cfe1972f0a21348d-unadjust_710_1001.jpeg?w=1125", "sales": 48, "seller_id": "1785418864", "seller_nick": "", "detail_url": "https://weidian.com/item.html?itemID=4162863529" }, { "title": "tanghulu mug 艺术家具 马卡龙色系糖葫芦咖啡杯", "num_iid": "4234886387", "price": 98, "orginal_price": 98, "promotion_price": 98, "pic_url": "https://si.geilicdn.com/wdseller1447298905-4cc5000001764f9c8db40a217216-unadjust_1124_1174.jpeg", "sales": 46, "seller_id": "1785418864", "seller_nick": "", "detail_url": "https://weidian.com/item.html?itemID=4234886387" }, { "title": "步履不停 新年礼物 家庭人手一双红红火火过大年 喜庆氛围袜子 男女同款(三双包邮)", "num_iid": "4276051344", "price": 8, "orginal_price": 8, "promotion_price": 8, "pic_url": "https://si.geilicdn.com/wdseller1447298905-3ead00000176f2e57bf90a21348d_800_1200.jpg", "sales": 46, "seller_id": "1785418864", "seller_nick": "", "detail_url": "https://weidian.com/item.html?itemID=4276051344" }, { "title": "加拿大运动品牌tna 人手一条高需求秋冬弹力高腰运动打底裤", "num_iid": "4057791539", "price": 76, "orginal_price": 76, "promotion_price": 76, "pic_url": "https://si.geilicdn.com/wdseller1447298905-179d0000017542a462580a21c2a8_1124_1182.jpg", "sales": 43, "seller_id": "1785418864", "seller_nick": "", "detail_url": "https://weidian.com/item.html?itemID=4057791539" }, { "title": "步履不停 男男女女老老少少皆可穿 羊毛混纺针织厚实毛袜子(5双包邮)", "num_iid": "4276072762", "price": 19, "orginal_price": 19, "promotion_price": 19, "pic_url": "https://si.geilicdn.com/wdseller1447298905-3efd00000176f2d5773e0a21c2a7_1124_1124.jpg", "sales": 43, "seller_id": "1785418864", "seller_nick": "", "detail_url": "https://weidian.com/item.html?itemID=4276072762" }, { "title": "Dou studio 秋冬混纺高领套头女士针织毛衣打底衫", "num_iid": "4226664141", "price": 128, "orginal_price": 128, "promotion_price": 128, "pic_url": "https://si.geilicdn.com/wdseller1447298905-515500000177048cbdb90a217216_1124_1500.jpg", "sales": 38, "seller_id": "1785418864", "seller_nick": "", "detail_url": "https://weidian.com/item.html?itemID=4226664141" }, { "title": "日单 多色秋冬oversize 纯色套头基础男女同款卫衣", "num_iid": "4234865463", "price": 98, "orginal_price": 98, "promotion_price": 98, "pic_url": "https://si.geilicdn.com/wdseller1447298905-75b5000001764e1176b20a217205-unadjust_790_1448.jpeg", "sales": 35, "seller_id": "1785418864", "seller_nick": "", "detail_url": "https://weidian.com/item.html?itemID=4234865463" }, { "title": "秋冬刚需必备 加绒加厚保暖 牛仔打底裤 三色", "num_iid": "4151263206", "price": 298, "orginal_price": 298, "promotion_price": 298, "pic_url": "https://si.geilicdn.com/wdseller1447298905-0c5100000175bddc87200a21348d-unadjust_1124_1500.jpeg", "sales": 34, "seller_id": "1785418864", "seller_nick": "", "detail_url": "https://weidian.com/item.html?itemID=4151263206" }, { "title": "happy socks 迪斯尼联名礼盒袜子ins潮 女", "num_iid": "4224764627", "price": 198, "orginal_price": 198, "promotion_price": 198, "pic_url": "https://si.geilicdn.com/wdseller1447298905-3a87000001763b7eb71d0a21c2a7-unadjust_640_705.jpeg", "sales": 29, "seller_id": "1785418864", "seller_nick": "", "detail_url": "https://weidian.com/item.html?itemID=4224764627" }, { "title": "比拥抱更温暖 来自内蒙古草原的馈赠纯羊毛围巾男女同款围巾 多色", "num_iid": "4244474625", "price": 188, "orginal_price": 188, "promotion_price": 188, "pic_url": "https://si.geilicdn.com/wdseller1447298905-6d4400000176635006580a21348d-unadjust_1125_1134.jpeg", "sales": 27, "seller_id": "1785418864", "seller_nick": "", "detail_url": "https://weidian.com/item.html?itemID=4244474625" }, { "title": "呀!好长一只腊肠狗 谁说长大后的不能有玩具?独居生活温暖好物 暖色系腊肠狗玩偶靠枕", "num_iid": "4270131842", "price": 98, "orginal_price": 98, "promotion_price": 98, "pic_url": "https://si.geilicdn.com/wdseller1447298905-2f0600000176dde56ea30a20b7b9_1125_1485.jpg?w=1125", "sales": 27, "seller_id": "1785418864", "seller_nick": "", "detail_url": "https://weidian.com/item.html?itemID=4270131842" }, { "title": "瑞典潮牌 Stalwart 复古小众 港味十足慢跑鞋", "num_iid": "4081762103", "price": 498, "orginal_price": 498, "promotion_price": 498, "pic_url": "https://si.geilicdn.com/wdseller1447298905-77380000017566ce7e370a217205-unadjust_1125_1315.jpeg", "sales": 26, "seller_id": "1785418864", "seller_nick": "", "detail_url": "https://weidian.com/item.html?itemID=4081762103" }, { "title": "大衣绝配 秋冬圆领羊毛混纺针织上衣 毛衣", "num_iid": "4235584538", "price": 128, "orginal_price": 128, "promotion_price": 128, "pic_url": "https://si.geilicdn.com/wdseller1447298905-6c42000001764e053d970a20b7b9-unadjust_1209_1845.jpeg", "sales": 26, "seller_id": "1785418864", "seller_nick": "", "detail_url": "https://weidian.com/item.html?itemID=4235584538" }, { "title": "B家超长超厚 狐狸毛领鹅绒填充可拆卸帽子女士羽绒服", "num_iid": "4033542331", "price": 1880, "orginal_price": 1880, "promotion_price": 1880, "pic_url": "https://si.geilicdn.com/wdseller1447298905-55f9000001760c5aa8a00a20b7b9-unadjust_1124_1500.jpeg", "sales": 23, "seller_id": "1785418864", "seller_nick": "", "detail_url": "https://weidian.com/item.html?itemID=4033542331" }, { "title": "Prad@ 原厂标齐 100%纯羊毛针织女士休闲裤", "num_iid": "4249743920", "price": 798, "orginal_price": 798, "promotion_price": 798, "pic_url": "https://si.geilicdn.com/wdseller1447298905-509300000176720b27600a20b7b9-unadjust_900_1100.jpeg", "sales": 23, "seller_id": "1785418864", "seller_nick": "", "detail_url": "https://weidian.com/item.html?itemID=4249743920" }, { "title": "澳洲羊毛冬季保暖针织抽绳休闲女款运动长裤", "num_iid": "4180378926", "price": 398, "orginal_price": 398, "promotion_price": 398, "pic_url": "https://si.geilicdn.com/wdseller1447298905-255d00000175e7de863a0a21348d-unadjust_1122_1496.jpeg", "sales": 23, "seller_id": "1785418864", "seller_nick": "", "detail_url": "https://weidian.com/item.html?itemID=4180378926" }, { "title": "出口日单 秋冬打底 不可辜负单品圆领套头衫", "num_iid": "4234938421", "price": 168, "orginal_price": 168, "promotion_price": 168, "pic_url": "https://si.geilicdn.com/wdseller1447298905-7e50000001764e209c670a217216-unadjust_2250_3333.jpeg", "sales": 23, "seller_id": "1785418864", "seller_nick": "", "detail_url": "https://weidian.com/item.html?itemID=4234938421" }, { "title": "M 冬季新款短款 鹅绒填充镭射白色光面面包羽绒服", "num_iid": "4033553399", "price": 1350, "orginal_price": 1350, "promotion_price": 1350, "pic_url": "https://si.geilicdn.com/wdseller1447298905-20dc0000017608517f360a217216-unadjust_1124_1752.jpeg?w=1125", "sales": 21, "seller_id": "1785418864", "seller_nick": "", "detail_url": "https://weidian.com/item.html?itemID=4033553399" }, { "title": "爆竹声中一岁除 施华洛世奇水晶新年特别礼故宫宫廷联名风格礼物首选福禄首饰", "num_iid": "4259836219", "price": 188, "orginal_price": 188, "promotion_price": 188, "pic_url": "https://si.geilicdn.com/wdseller1447298905-0d5c00000176a20a640e0a21348d-unadjust_750_750.jpeg?w=1125", "sales": 21, "seller_id": "1785418864", "seller_nick": "", "detail_url": "https://weidian.com/item.html?itemID=4259836219" } ] }, "error_code": "0000", "reason": "ok", "secache": "0d0ed7bb4627f1b41cd6caaeea8bfbc1", "secache_time": 1611125558, "secache_date": "2021-01-20 14:52:38", "translate_status": "", "translate_time": 0, "language": { "default_lang": "cn", "current_lang": "cn" }, "error": "", "cache": 0, "api_info": "today:1 max:5000", "execution_time": 0.923, "server_time": "Beijing/2021-01-20 14:52:38", "client_ip": "115.151.186.91", "call_args": { "seller_nick": "1785418864" }, "api_type": "micro", "translate_language": "zh-CN", "translate_engine": "baidu", "server_memory": "2.76MB", "request_id": "1.6007d33539b5c" }
{ "error": "item-not-found", "reason": "商品没找到", "error_code": "2000", "success": 0, "cache": 0, "api_info": "today:0 max:10000", "execution_time": 0.081, "server_time": "Beijing/2020-06-10 23:44:00", "call_args": [], "api_type": "taobao", "request_id": "15ee0ffc041242"}