---
title: capture_request_params (Python agent API)
source: https://docs.newrelic.com/docs/apm/agents/python-agent/python-agent-api/capturerequestparams-python-agent-api
---

## Syntax

```py
newrelic.agent.capture_request_params(flag=True)
```

Enables capture of a transaction's query string parameters.

## Description

This call enables the capture of a web transaction's query string parameters as [attributes](https://docs.newrelic.com/docs/accounts-partnerships/education/getting-started-new-relic/glossary#attribute). This collection is blocked by default for security reasons. If you instead want to enable query string parameter collection for your entire app, use the [`record_sql`](https://docs.newrelic.com/docs/agents/python-agent/installation-configuration/python-agent-configuration#txn-tracer-sql) configuration setting.

[High-security mode](https://docs.newrelic.com/docs/accounts-partnerships/accounts/security/high-security) overrides this call if it is active, in which case this call has no effect. This call overrides other relevant settings in the agent's [configuration](https://docs.newrelic.com/docs/agents/python-agent/installation-configuration/python-agent-configuration).

> #### 💡 TIP
>
> You can also enable query string capture in the WSGI environ dictionary. To do so, flag the `newrelic.capture_request_params` key for the specific request in the WSGI environ dictionary passed by the WSGI server into the target WSGI app.

## Parameters

| Parameter        | Description                                                     |
| ---------------- | --------------------------------------------------------------- |
| `flag` _boolean_ | Optional. Default is `True`. Use `False` to disable collection. |

## Return values

None.

## Examples

### Enable query string capture [#capture-example]

Place this call in the section of code corresponding to a transaction for which you want to collect query string parameters:

```py
newrelic.agent.capture_request_params()
```
