# Paging results from google custom search service

There is no 'MinItems' suboption, so what is the limit per request? How can I page through results, say like if I wanted the first 2k images from a search?

results =
"Search", {"Query" -> "Albrecht Altdorfer", MaxItems -> 2000,
"SearchType" -> "Image"}]


Update:

I tried using C.E.'s suggestion:

Do[
idx = 0;
b = InternalBag[];
{t, res} = AbsoluteTiming[While[True,
Check[
InternalStuffBag[b,
"Search", {"Query" -> "Dali", MaxItems -> step,
"StartIndex" -> idx, "SearchType" -> "Image"}][All,
idx = idx + step;
]];
Print[Row@{"step = ", step, ", count = ",
Length@Flatten@InternalBagPart[b, All], ", time = ",
t}], {step, {1, 2, 10, 50}}]


But with the free tier Google blocks you after 100 requests:

and after 1k results you are blocked for the day:

So the question remains how to pull images with StartIndex > 100 in a single day.

• There is a StartIndex parameter right below MaxItems in the documentation. Did you try it? – C. E. Aug 16 '16 at 19:48
• Have you tried it? Did it work? – C. E. Aug 19 '16 at 20:28
• @C.E. See my updates. – M.R. Aug 20 '16 at 23:34
• Maybe I'm just dense but I'm having a hard time deciphering this. You're saying "so the question remains..." as if the problem is partially solved, but you have many error messages, where do they come from? And why is count always 101, shouldn't it be increasing by step`? It is also unclear if the limit is 100 or 1000. – C. E. Aug 21 '16 at 21:34