# Error in Querying Data from Influx Python Client

**URL:** <https://community.influxdata.com/t/error-in-querying-data-from-influx-python-client/20966>\
**Category:** Client SDKs\
**Tags:** python\
**Created:** [July 29, 2021, 8:16pm UTC](https://community.influxdata.com/t/error-in-querying-data-from-influx-python-client/20966 "2021-07-29T20:16:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![raginigupta6](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@raginigupta6](https://community.influxdata.com/u/raginigupta6)\
**Post date:** [July 29, 2021, 8:16pm UTC](https://community.influxdata.com/t/error-in-querying-data-from-influx-python-client/20966/1 "2021-07-29T20:16:31Z")

</div>

Hi there,

I am using Python Influx Client library and getting HTTP response error. Here’s how I am trying to query:

```auto
query = 'from(bucket:"PythonClient") |> range(start: -10m) |> filter(fn:(r) => r._measurement == “Company”)'

#tables = query_api.query('from(bucket:"PythonClient") |> range(start: -10m)')
result = client.query_api().query(org=org, query=query)

results = []
for table in result:
    for record in table.records:
        results.append((record.get_value(), record.get_field()))
print(results)

```

Error:  
HTTP response headers: HTTPHeaderDict({‘Content-Type’: ‘application/json; charset=utf-8’, ‘Vary’: ‘Accept-Encoding’, ‘X-Platform-Error-Code’: ‘invalid’, ‘Date’: ‘Thu, 29 Jul 2021 20:04:50 GMT’, ‘Transfer-Encoding’: ‘chunked’})  
HTTP response body: b’{“code”:“invalid”,“message”:“compilation failed: error at @1:61-1:99: invalid expression @1:99-1:102: \xe2\x80\x9d”}'4

Any feedback on this would be great help. Thanks
