# Exchange Rate Updated — CurrencyScoop

> Emit new event when the exchange rate for a currency is updated See the documentation

- Key: `currencyscoop-exchange-rate-updated`
- Type: Trigger (Polling)
- Version: 0.0.1
- App: CurrencyScoop (`currencyscoop`) — https://pipedream.com/apps/currencyscoop.md
- This page (HTML): https://pipedream.com/apps/currencyscoop/triggers/exchange-rate-updated
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/currencyscoop/sources/exchange-rate-updated/exchange-rate-updated.ts

## Description

Emit new event when the exchange rate for a currency is updated [See the documentation](https://currencybeacon.com/api-documentation)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `timer` | `$.interface.timer` | Yes | Timer |
| `base` | `string` | Yes | The base currency to use for your rates. |
| `targetCurrency` | `string` | Yes | The currency you would like to see the rates for. See all supported currencies here. |
| `threshold` | `string` | No | If specified, a new event will only be emitted when the rate has changed by at least this amount since the last event. For example, if Threshold is 0.2 and the initial rate obtained is 3.0, a new event will only be emitted when it reaches 2.8 or 3.2. |

## Returns

Events emitted by CurrencyScoop.

## Run it

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const deployed = await pd.triggers.deploy({
  id: "currencyscoop-exchange-rate-updated",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    currencyscoop: { authProvisionId: "apn_xxxxxxx" },
    timer: { "intervalSeconds": 900 },
    base: "Base Currency",
  },
  webhookUrl: "https://example.com/webhooks/currencyscoop",
})

console.log(deployed.id)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/triggers/deploy \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "currencyscoop-exchange-rate-updated",
    "webhook_url": "https://example.com/webhooks/currencyscoop",
    "configured_props": {
      "currencyscoop": { "authProvisionId": "apn_xxxxxxx" },
      "timer": { "intervalSeconds": 900 },
      "base": "Base Currency"
    }
  }'
```

**MCP**

MCP servers expose CurrencyScoop actions as on-demand tools.

Exchange Rate Updated is an event source, so your application deploys it with the Connect SDK or API and then either receives each event at a webhook URL or retrieves events on demand with the trigger events API.

## Event delivery

Every event is sent to the HTTP endpoint you choose when you deploy the source. Or: no webhook required — your app or agent can fetch recent events from the [trigger events API](https://pipedream.com/docs/connect/api-reference/list-trigger-events.md) instead.

---

- App: https://pipedream.com/apps/currencyscoop.md · All apps: https://pipedream.com/apps
