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

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.

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.

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:

<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:

<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
If your application is using python to call our API we provide a client with authentication and paging built in: combocurve-api-v1 · PyPI

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.

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.

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 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.

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.