【问题标题】:Etsy API call for standard searchEtsy API 调用标准搜索
【发布时间】:2016-10-15 09:58:44
【问题描述】:

etsy.com 上进行标准搜索的Esty api 调用是什么?
我想在etsy.com上搜索“winter giraffe”时得到结果数,即472。

到目前为止,我有:

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。所以这也不是它..

【问题讨论】:

    标签: api search etsy


    【解决方案1】:

    对我来说,检查关键字参数值的内容并不明显。 使用 tags 而不是 keywords 可能会更好:

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-10-25
      • 1970-01-01
      • 2022-06-16
      • 1970-01-01
      • 1970-01-01
      • 2023-03-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多