# Get-daily-productions endpoint returning a portion of the data

**URL:** <https://forum.api.combocurve.com/t/get-daily-productions-endpoint-returning-a-portion-of-the-data/220>\
**Category:** Forum\
**Created:** [May 8, 2023, 8:07pm UTC](https://forum.api.combocurve.com/t/get-daily-productions-endpoint-returning-a-portion-of-the-data/220 "2023-05-08T20:07:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![CCDW](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@CCDW](https://forum.api.combocurve.com/u/CCDW)\
**Post date:** [May 8, 2023, 8:07pm UTC](https://forum.api.combocurve.com/t/get-daily-productions-endpoint-returning-a-portion-of-the-data/220/1 "2023-05-08T20:07:13Z")

</div>

Hi CC Team,

The get-daily-productions endpoint of one well returns a portion of the data. I wonder how to the rest of the daily productions for the well. I have set the well parameter, which seems to work. I see date parameter is not optional in the documentation. I don’t know what the correct value is, so I have not provided that parameter during the get call.

Please let me know.

Thanks.

---

<div class="post-metadata">

**Author:** ![Jeff\_Hopkins](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.api.combocurve.com/jeff_hopkins/32/119_2.png) [@Jeff\_Hopkins](https://forum.api.combocurve.com/u/Jeff_Hopkins)\
**Post date:** [May 8, 2023, 9:28pm UTC](https://forum.api.combocurve.com/t/get-daily-productions-endpoint-returning-a-portion-of-the-data/220/2 "2023-05-08T21:28:14Z")

</div>

Our API returns a limited number of records per request in order to keep latency and response size down. This record limit can be seen in our documentation on a per-endpoint basis. For Production records this limit is set to 20000 records per request.

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/the_combocurve_api/original/1X/211e7a21e420e3378623d55d82fbc69bd4387c62.png)

In order to fetch data past the first 20000 records (or however large your `take` value is) you will have to page through the results. We provide two ways to do this for most of our GET endpoints, either skip/take pagination or cursor pagination.

Skip/take pagination is opted in to by passing in a `skip` value in the querystring (ex. /v1/daily-productions?skip=0&take=25). When a `skip` querystring is used the response will contain a `Link` header with links to relevant associated result sets.

Here is an example of a `Link` header value when querying the first 25 records from the `get-daily-productions` endpoint using skip/take pagination:

```auto
<https://test-api.combocurve.com/v1/daily-productions?skip=25&take=25>;rel="next",<https://test-api.combocurve.com/v1/daily-productions?skip=0&take=25>;rel="first"

```

You will note that the header value contains two URLs differentiated by the `rel` property. The “next” link will point to the next record set, and the “first” link will point back to the first record set.

Cursor pagination is used by default (on supported endpoints) if a `skip` querystring parameter is not passed in. In this case the `Link` header will still provide links to related record sets, but instead of using the `skip` and `take` querystring parameters it will use `cursor` and `take`.

Here is an example of a `Link` header value when querying the first 25 records from the `get-daily-productions` endpoint using cursor pagination:

```auto
<https://test-api.combocurve.com/v1/daily-productions?take=25&cursor=xxxxxxxxxxxx>;rel="next",<https://test-api.combocurve.com/v1/daily-productions?take=25>;rel="first"

```

If your application is using c# call our API we provide a client with authentication and paging built in: [NuGet Gallery | ComboCurve.Api 1.23.6](https://www.nuget.org/packages/ComboCurve.Api)  
If your application is using python to call our API we provide a client with authentication and paging built in: [combocurve-api-v1 · PyPI](https://pypi.org/project/combocurve-api-v1/)

---

<div class="post-metadata">

**Author:** ![Jeff\_Hopkins](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.api.combocurve.com/jeff_hopkins/32/119_2.png) [@Jeff\_Hopkins](https://forum.api.combocurve.com/u/Jeff_Hopkins)\
**Post date:** [May 8, 2023, 9:31pm UTC](https://forum.api.combocurve.com/t/get-daily-productions-endpoint-returning-a-portion-of-the-data/220/3 "2023-05-08T21:31:12Z")

</div>

In general, the querystring parameters listed in our documentation for GET endpoints are optional. In the case where a querystring parameter is not optional, a validation error should be returned if the parameter is missing.

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/the_combocurve_api/original/1X/79bd92d289d0562d46525e28c305d000c0000a85.png)

---

<div class="post-metadata">

**Author:** ![CCDW](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@CCDW](https://forum.api.combocurve.com/u/CCDW)\
**Post date:** [May 8, 2023, 9:50pm UTC](https://forum.api.combocurve.com/t/get-daily-productions-endpoint-returning-a-portion-of-the-data/220/4 "2023-05-08T21:50:56Z")

</div>

Thanks Jeff. One follow-up question: what is the most sensible way to construct the loop for skip/take method (the first method), in which I have to increment the skip counter? I have been checking the returned json string to see if there are any records returned in order to stop an infinite loop. Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Jeff\_Hopkins](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.api.combocurve.com/jeff_hopkins/32/119_2.png) [@Jeff\_Hopkins](https://forum.api.combocurve.com/u/Jeff_Hopkins)\
**Post date:** [May 8, 2023, 10:09pm UTC](https://forum.api.combocurve.com/t/get-daily-productions-endpoint-returning-a-portion-of-the-data/220/5 "2023-05-08T22:09:13Z")

</div>

If you are modifying the `skip` parameter directly in a loop, you could first call the HEAD method to determine the number of records that should be available in your result set. In this case it would be the [head-daily-productions](https://docs.api.combocurve.com/#38db01ae-c768-4a68-878a-321924d2d52f) endpoint. You would call this endpoint with the same filters that you are applying to the GET method. It would then return an `X-Query-Count` header with the expected number of records for your query.

Another option would be to take advantage of the `Link` header that is returned with our responses. For the last page in a given result set, the `Link` header will not return a “next” link. So, you could make a request, examine the `Link` header for `rel="next"`, and break your loop if the next link is not found.

---

<div class="post-metadata">

**Author:** ![CCDW](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@CCDW](https://forum.api.combocurve.com/u/CCDW)\
**Post date:** [May 9, 2023, 9:36am UTC](https://forum.api.combocurve.com/t/get-daily-productions-endpoint-returning-a-portion-of-the-data/220/6 "2023-05-09T09:36:15Z")

</div>

Thanks Jeff. The response headers do give the looping information, which helps to better structure the code. Also, the head-xxx APIs provides the upper limits. That is very helpful as well.
