etsy.comEsty
上标准搜索的api 调用是什么?
我想在搜索“冬季长颈鹿”时获得结果数,即 472。etsy.com
到目前为止,我有:
String api_key = ...;
String terms = "winter+giraffe";
try{
String output = getHTML("https://openapi.etsy.com/v2/listings/active.js?keywords="+
terms+"&limit=12&includes=Images:1&api_key="+api_key);
String input = output;
int index = input.indexOf("listing_id");
int count = 0;
while (index != -1) {
count++;
input = input.substring(index + 1);
index = input.indexOf("listing_id");
}
System.out.println("\nNo of listings is : " + count);
}
catch(Exception e){System.out.println("Something went wrong.");}
问题是这给了我
“列表数量为:24”
此外,在输出字符串中,它说:
“计数”:50100。所以这也不是它..