# Fetch Privacy Data

Fetch underlying PII for an individual or business by a known wallet address. This is a privacy data query and incurs Quad Unit charges. This feature must be enabled for your dApp.

## Parameters

<table><thead><tr><th width="247">Name</th><th width="235">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>apiKey</code><mark style="color:red;"><code>*</code></mark></td><td>string</td><td>Your API Key</td></tr><tr><td><code>walletAddress</code><mark style="color:red;"><code>*</code></mark></td><td>hex string</td><td>Wallet address</td></tr><tr><td><code>privateKeyDerBase64</code></td><td>string</td><td>Base64 DER String</td></tr><tr><td><code>privateKeyDer</code></td><td>string</td><td>DER Binary String</td></tr><tr><td><code>privateKeyPem</code></td><td>string</td><td>PEM String</td></tr><tr><td><code>privateKey</code></td><td>CryptoKey</td><td>CryptoKey object</td></tr><tr><td><code>privacyAccessToken</code></td><td>string</td><td>Access token <br><em>If not provided, one will be generated</em><br><em>See</em> <a href="create-privacy-access-token"><em>createPrivacyAccessToken</em></a></td></tr><tr><td><code>scopes</code></td><td>QuadrataPrivacyConsent[]</td><td>Sparse scopes to fetch<br><em>If you don't want everything</em></td></tr><tr><td><code>options</code></td><td>object</td><td>Fetch Options</td></tr></tbody></table>

{% hint style="info" %}
One private key parameter is required. You can provide your private key in any of the formats listed.

See [API Service Options](https://docs.quadrata.com/integration/how-to-integrate/quadrata-sdk/advanced/api-libraries/api-service-options) for more information
{% endhint %}

## SDK Configuration

<table><thead><tr><th width="257">Name</th><th width="211">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>environment</code><mark style="color:red;"><code>*</code></mark></td><td>QuadrataEnvironment</td><td>Access token<br>See <a href="create-access-token">createAccessToken</a></td></tr></tbody></table>

{% hint style="info" %}
See [API Get Privacy Data](https://docs.quadrata.com/integration/how-to-integrate/request-privacy-data/api-requests/api-get-privacy-data) for more information about the underlying API endpoint.
{% endhint %}

## Example

```typescript
import type { API } from '@quadrata/sdk/api';
import { fetchPrivacyData, QuadrataEnvironment } from '@quadrata/sdk/api';

type ResponseType = API.Service.FetchPrivacyData.Response;
type ParsedResponseType = API.Service.FetchPrivacyData.ParsedResponse;

const response: ResponseType = await fetchPrivacyData(
    // params
    {
        apiKey: process.env.QUADRATA_API_KEY,
        walletAddress: '0x123',
        
        // private signing key
        privateKeyDerBase64: process.env.QUADRATA_PRIVATE_KEY_DER_BASE64,
        
        // optional, if not provided, will be generated for you
        privacyAccessToken: 'access token from createPrivacyAccessToken',
        
        // optional sparse scopes
        scopes: [
            QuadrataPrivacyConsent.EMAIL,
            QuadrataPrivacyConsent.DATE_OF_BIRTH
        ],
        
        // optional fetch options
        options: {
            cache: 'no-cache'
        }
    },
    // sdk config
    { environment: QuadrataEnvironment.PRODUCTION }
);

const attributes: ParsedResponseType = response.data.attributes;
```
