# How to ingest paginated API data into Elasticsearch?

**URL:** https://discuss.elastic.co/t/how-to-ingest-paginated-api-data-into-elasticsearch/386648
**Category:** Elasticsearch
**Created:** [June 2, 2026, 11:54am UTC](https://discuss.elastic.co/t/how-to-ingest-paginated-api-data-into-elasticsearch/386648 "2026-06-02T11:54:16Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![1o1o](https://avatars.discourse-cdn.com/v4/letter/1/a5b964/32.png) [@1o1o](https://discuss.elastic.co/u/1o1o)
#### Post date: [June 2, 2026, 11:54am UTC](https://discuss.elastic.co/t/how-to-ingest-paginated-api-data-into-elasticsearch/386648/1 "2026-06-02T11:54:16Z")

</div>

Hi everyone,

I’m trying to ingest data from a web application API into an Elasticsearch index.

Context:

- The API is HTTP-based and returns JSON data

- It supports pagination cursor-based

- I need to regularly fetch all data and index it into Elasticsearch

What I tried:

- I tried using Logstash with the http\_poller input plugin

- However, it seems that http\_poller does not support pagination (or I couldn’t find a way to implement it)

Current workaround:

- I wrote a Python script that fetches data from the API and pushes it to Elasticsearch

- It works, but I would prefer a more "ELK-native" solution if possible

My question:

- Is there a way to handle paginated API ingestion using Logstash or another Elastic tool ?

- Or is using a custom script (Python) the recommended approach in this case ?

Any feedback or best practices would be appreciated.

Thanks in advance !

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [June 2, 2026, 7:51pm UTC](https://discuss.elastic.co/t/how-to-ingest-paginated-api-data-into-elasticsearch/386648/2 "2026-06-02T19:51:25Z")

</div>

Hello and welcome,

The `http_poller` input cannot paginate, the recommended native way would to use `cel` input with an Elastic Agent as described [here](https://www.elastic.co/docs/reference/integrations/cel).

Since you will need to learn how to code using CEL, I would say that it is way easier to just use Python, this is what I do in similar cases.
