# Searching Using Curl returns only 20 results a Page

**URL:** <http://forum.companieshouse.gov.uk/t/searching-using-curl-returns-only-20-results-a-page/1454>\
**Category:** Uncategorized\
**Created:** [November 9, 2017, 10:08am UTC](http://forum.companieshouse.gov.uk/t/searching-using-curl-returns-only-20-results-a-page/1454 "2017-11-09T10:08:25Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![voracityemail](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/v/b77776/32.png) [@voracityemail](http://forum.companieshouse.gov.uk/u/voracityemail)\
**Post date:** [November 10, 2017, 12:35pm UTC](http://forum.companieshouse.gov.uk/t/searching-using-curl-returns-only-20-results-a-page/1454/6 "2017-11-10T12:35:46Z")

</div>

Good you’ve got it working.

When using curl, _did you enclose the https://… part in quotes_? Your example doesn’t show any.

(If you did so then the info below won’t apply. I don’t know what’s wrong but for help post exactly which command you issued to curl [without your API key details obviously] and the response you received.)

That might be the reason why you got the same information using a different “items\_per\_page”. The command line / in Windows / many linux shells will split the command you gave above into 3, after the “&” character.

So if you run (using “tesco” as search term):

```
curl -u myKey: https://api.companieshouse.gov.uk/search?q=tesco&items_per_page=20&start_index=0

```

This is intepreted as 3 commands:

```
https://api.companieshouse.gov.uk/search?q=tesco
items_per_page=20
start_index=0

```

The first will happily give the first page of results (as if you’d set “start\_index+0”).

When you run  
… and then the system tries to run:

```
curl -u myKey: https://api.companieshouse.gov.uk/search?q=tesco&items_per_page=20&start_index=20

```

…again the shell / command line will split this up and you’ll get the same command as you had before sent via curl:

```
https://api.companieshouse.gov.uk/search?q=tesco

```

See:

> [@Curl call gets stuck](http://forum.aws.chdev.org/t/curl-call-gets-stuck/1410):
>
> My curl call doesn’t complete - it gets ends up showing the end of the JSON response and you have to press [enter] to get the final 2 lines (e.g. [1]- Done ...) to print to shell. And \> report.json isn’t capturing the response as the resulting file is empty. Call and response below, with JSON removed for sake of space (but it is a correct response). I just want curl to report the json to file and end without having to press enter. I’m not massively experienced with REST so I’m probably miss…

---

_[View the full topic](http://forum.companieshouse.gov.uk/t/searching-using-curl-returns-only-20-results-a-page/1454)._
