首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Etsy API调用标准搜索

Etsy API调用标准搜索
EN

Stack Overflow用户
提问于 2016-09-26 18:51:33
回答 1查看 933关注 0票数 0

什么是Esty api对etsy.com的标准搜索调用?

etsy.com上搜索“冬季长颈鹿”时,我想得到的结果是472。

到目前为止,我已经:

代码语言:javascript
复制
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。所以这也不是..。

EN

回答 1

Stack Overflow用户

发布于 2016-10-15 00:33:18

在我看来,对关键字参数值的检查并不明显。使用标记而不是关键字可能会更幸运。

代码语言:javascript
复制
String output = getHTML("https://openapi.etsy.com/v2/listings/active.js?tags="+terms+"&limit=12&includes=Images:1&api_key="+api_key);

(我通过这个查询得到了7个结果。)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39710256

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档