# Get Latest Quotes — CoinMarketCap

> Returns the latest market quote for 1 or more cryptocurrencies. Use the ""convert"" option to return market values in multiple fiat and cryptocurrency conversions in the same call. At least one ""id"" or ""slug"" or ""symbol"" is required…

- Key: `coinmarketcap-latest-quotes`
- Type: Action (Read-only)
- Version: 0.1.4
- App: CoinMarketCap (`coinmarketcap`) — https://pipedream.com/apps/coinmarketcap.md
- This page (HTML): https://pipedream.com/apps/coinmarketcap/actions/latest-quotes
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/coinmarketcap/actions/latest-quotes/latest-quotes.mjs

## Description

Returns the latest market quote for 1 or more cryptocurrencies. Use the ""convert"" option to return market values in multiple fiat and cryptocurrency conversions in the same call. At least one ""id"" or ""slug"" or ""symbol"" is required for this request. [See the documentation](https://coinmarketcap.com/api/documentation/v1/#operation/getV1CryptocurrencyQuotesLatest)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `id` | `string` | No | One or more comma-separated cryptocurrency CoinMarketCap IDs. Example: 1,2 |
| `slug` | `string` | No | Alternatively pass a comma-separated list of cryptocurrency slugs. Example: "bitcoin,ethereum" |
| `symbol` | `string` | No | Alternatively pass one or more comma-separated cryptocurrency symbols. Example: "BTC,ETH". |
| `convert` | `string` | No | Optionally calculate market quotes in up to 120 currencies at once by passing a comma-separated list of cryptocurrency or fiat currency symbols. Each additional convert option beyond the first requires an additional call credit. A list of supported fiat options can be found at https://coinmarketcap.com/api/documentation/v1/#section/Standards-and-Conventions. Each conversion is returned in its own "quote" object. |
| `convertId` | `string` | No | Optionally calculate market quotes by CoinMarketCap ID instead of symbol. This option is identical to convert outside of ID format. Ex: Convert ID = 1,2781 would replace Convert = BTC,USD in your query. This parameter cannot be used when Convert is used. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
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 accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "coinmarketcap",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "coinmarketcap-latest-quotes",
  arguments: {
    id: "Id",
    slug: "Slug",
  },
})
```

**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 result = await pd.actions.run({
  id: "coinmarketcap-latest-quotes",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    coinmarketcap: { authProvisionId: "apn_xxxxxxx" },
    id: "Id",
    slug: "Slug",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "coinmarketcap-latest-quotes",
    "configured_props": {
      "coinmarketcap": { "authProvisionId": "apn_xxxxxxx" },
      "id": "Id",
      "slug": "Slug"
    }
  }'
```

---

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