# Examples

{% tabs %}
{% tab title="Javascript" %}

```javascript
import axios from 'axios';

const API_URL = 'https://pro.circular.fi/finder';
const API_KEY = 'your-api-key'; // Replace with your key

const params = {
  tokensMint: ['So11111111111111111111111111111111111111112'].join(','),
  tokensExclude: [
    'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', // USDC
    'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB'  // USDT
  ].join(','),
  tokensMax: 10,
  tokensTimeRange: 3600,
  tokensAMMS: ['LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo,5'].join(','),

  thresholdMaxTimeRange: 3600,
  thresholdProfits: 0,
  thresholdRevenues: 0,
  thresholdTransactions: 0,
  thresholdProvider: 'ALL',
  thresholdBot: 'ALL',

  percentilesFees: 'p50',
  percentilesTips: 'p50',
  percentilesProvider: 'ALL',
  percentilesBot: 'ALL',
  percentilesTimeRange: 3600
};

async function getFinder() {
  try {
    const res = await axios.get(API_URL, {
      headers: { 'Content-Type': 'application/json', 'x-api-key': API_KEY },
      params
    });
    console.log('Finder:', res.data);
  } catch (e) {
    console.error('Error:', e?.response?.data || e.message);
  }
}

getFinder();
```

{% endtab %}

{% tab title="Typescript" %}

```typescript
const API_URL = 'https://pro.circular.fi/finder';
const API_KEY = 'your-api-key';

const params = {
  tokensMint: ['So11111111111111111111111111111111111111112'].join(','),
  tokensExclude: [
    'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', // USDC
    'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB'  // USDT
  ].join(','),
  tokensMax: 10,
  tokensTimeRange: 3600,
  tokensAMMS: ['LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo,5'].join(','),

  thresholdMaxTimeRange: 3600,
  thresholdProfits: 0,
  thresholdRevenues: 0,
  thresholdTransactions: 0,
  thresholdProvider: 'ALL',
  thresholdBot: 'ALL',

  percentilesFees: 'p50',
  percentilesTips: 'p50',
  percentilesProvider: 'ALL',
  percentilesBot: 'ALL',
  percentilesTimeRange: 3600
};

// Helper to build a querystring from the params object
const qs = new URLSearchParams(
  Object.entries(params).map(([k, v]) => [k, String(v)])
);

async function getFinder(): Promise<void> {
  try {
    const res = await fetch(`${API_URL}?${qs.toString()}`, {
      headers: { 'Content-Type': 'application/json', 'x-api-key': API_KEY }
    });
    if (!res.ok) throw new Error(`${res.status} ${res.statusText}`);
    const data = await res.json();
    console.log('Finder:', data);
  } catch (e: any) {
    console.error('Error:', e?.message ?? e);
  }
}

getFinder();

```

{% endtab %}

{% tab title="Python" %}

```python
import requests

API_URL = "https://pro.circular.fi/finder"
API_KEY = "your-api-key"

params = {
    "tokensMint": ",".join(["So11111111111111111111111111111111111111112"]),
    "tokensExclude": ",".join([
        "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",  # USDC
        "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"   # USDT
    ]),
    "tokensMax": 10,
    "tokensTimeRange": 3600,
    "tokensAMMS": ",".join(["LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo,5"]),

    "thresholdMaxTimeRange": 3600,
    "thresholdProfits": 0,
    "thresholdRevenues": 0,
    "thresholdTransactions": 0,
    "thresholdProvider": "ALL",
    "thresholdBot": "ALL",

    "percentilesFees": "p50",
    "percentilesTips": "p50",
    "percentilesProvider": "ALL",
    "percentilesBot": "ALL",
    "percentilesTimeRange": 3600
}

headers = {
    "Content-Type": "application/json",
    "x-api-key": API_KEY
}

try:
    r = requests.get(API_URL, headers=headers, params=params, timeout=20)
    r.raise_for_status()
    print("Finder:", r.json())
except requests.HTTPError as e:
    print("Error:", getattr(e.response, "text", str(e)))

```

{% endtab %}

{% tab title="Rust" %}

```rust
use reqwest::blocking::Client;
use std::collections::HashMap;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let api_url = "https://pro.circular.fi/finder";
    let api_key = "your-api-key";

    let mut params = HashMap::new();
    params.insert("tokensMint", "So11111111111111111111111111111111111111112");
    params.insert(
        "tokensExclude",
        "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v,Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"
    );
    params.insert("tokensMax", "10");
    params.insert("tokensTimeRange", "3600");
    params.insert("tokensAMMS", "LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo,5");

    params.insert("thresholdMaxTimeRange", "3600");
    params.insert("thresholdProfits", "0");
    params.insert("thresholdRevenues", "0");
    params.insert("thresholdTransactions", "0");
    params.insert("thresholdProvider", "ALL");
    params.insert("thresholdBot", "ALL");

    params.insert("percentilesFees", "p50");
    params.insert("percentilesTips", "p50");
    params.insert("percentilesProvider", "ALL");
    params.insert("percentilesBot", "ALL");
    params.insert("percentilesTimeRange", "3600");

    let client = Client::new();
    let res = client
        .get(api_url)
        .header("Content-Type", "application/json")
        .header("x-api-key", api_key)
        .query(&params)
        .send()?
        .error_for_status()?
        .text()?;

    println!("Finder: {}", res);
    Ok(())
}

```

{% endtab %}
{% endtabs %}
