What is the Esty
api call for the standard search on etsy.com?
I would like to get the number of results when searching for "winter giraffe" on etsy.com
, which is 472.
So far, I have:
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.");}
The problem is that this gives me
"No of listings is :24"
Also, in the output string, it says :
"count":50100. So that is also not it..