# Test Rest API through python

**URL:** <https://discuss.elastic.co/t/test-rest-api-through-python/357531>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-monitoring\
**Created:** [April 16, 2024, 4:50pm UTC](https://discuss.elastic.co/t/test-rest-api-through-python/357531 "2024-04-16T16:50:13Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![navya\_k](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/navya_k/32/127091_2.png) [@navya\_k](https://discuss.elastic.co/u/navya_k)\
**Post date:** [April 23, 2024, 4:16pm UTC](https://discuss.elastic.co/t/test-rest-api-through-python/357531/12 "2024-04-23T16:16:52Z")

</div>

Thank you for reply jessgarson.

It's not working for me..as my system not compatable with flask.

I have raised another discussion. Here is the link :

> [@How to provide input from keyboard to script. Input can be service name or application](https://discuss.elastic.co/t/how-to-provide-input-from-keyboard-to-script-input-can-be-service-name-or-application/358046):
>
> Hello, I have written below code to accept input from keyboard and retrieve data from elasticsearch cluster from elasticsearch import Elasticsearch from datetime import datetime es = Elasticsearch ("[https://localhost](https://localhost)", api\_key="ACKRUSGHUSGHEHYFIRHU==") Index\_pattern = "test-\*" service\_name = input("Enter service name: ") query = { "query": { "bool": { "must": [ { "range": { "@timestamp": { "gte": "now-1h" } } }, { "term": { "service.name": 'service\_name' #here using above …

Please have a look and help me out for solution...

---

_[View the full topic](https://discuss.elastic.co/t/test-rest-api-through-python/357531)._
