# Why is such a difference between the time of a query request within the kibana console and the query request from a python script

**URL:** <https://discuss.elastic.co/t/why-is-such-a-difference-between-the-time-of-a-query-request-within-the-kibana-console-and-the-query-request-from-a-python-script/213876>\
**Category:** Elasticsearch\
**Created:** [January 6, 2020, 10:51am UTC](https://discuss.elastic.co/t/why-is-such-a-difference-between-the-time-of-a-query-request-within-the-kibana-console-and-the-query-request-from-a-python-script/213876 "2020-01-06T10:51:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aianau](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aianau/32/60321_2.png) [@aianau](https://discuss.elastic.co/u/aianau)\
**Post date:** [January 6, 2020, 10:51am UTC](https://discuss.elastic.co/t/why-is-such-a-difference-between-the-time-of-a-query-request-within-the-kibana-console-and-the-query-request-from-a-python-script/213876/1 "2020-01-06T10:51:05Z")

</div>

I am trying to retrieve **a lot** of data from kibana using a python script. But I get unsatisfactory query time of execution, so I tried querying from within the `dev_tools/console` inside kibana. Doing a DSL query from console, it takes at a maximum of 15 secs in all cases to retrieve results.

From the python script I am trying to get the data using `/_search?scroll=5m` because I've read it is better to use scroll (( `Scroll [The Scroll api is recommended for efficient deep scrolling but scroll contexts are costly and it is not recommended to use it for real time user requests.]` )) as I just want to retrieve data, not real time requests. (or am I wrong?)

Within the Python script it takes ~3 mins at least using `requests` module.

The DSL queries used for each are the same. The difference is in the urls used:

- python using `requests` module: `kibana_site:some_port_1/some_index/_search?scroll=5m`
- dev console: `kibana_site:some_port_2/app/kibana#/dev_tools/console?_g=()`

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 3, 2020, 10:51am UTC](https://discuss.elastic.co/t/why-is-such-a-difference-between-the-time-of-a-query-request-within-the-kibana-console-and-the-query-request-from-a-python-script/213876/2 "2020-02-03T10:51:12Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
