---
title: "BCV rate widget | The BCV dollar on your website, free · BCV Today"
description: "Show today"
url: "https://bcv.today/en/widget/"
tokens: 1144
---

# BCV rate widget

Show today's official BCV rate on any website with one line of code, for free.

The data is published under [CC BY 4.0](https://bcv.today/en/license/): if you show it, credit the source.

## Configure it

The configurator needs JavaScript. Here is the basic code: paste it into your page and adjust the attributes with the [reference](https://bcv.today/en/widget/#reference) below.
Currency  US dollar (USD) Euro (EUR) Chinese yuan (CNY) Turkish lira (TRY) Russian ruble (RUB)    Variant   Card  Inline  Converter    Initial amount
In the chosen currency. If empty, the converter starts at 1.
Language   Your page's  Español  English    Theme   Automatic  Light  Dark      Hide the "Source: BCV Today" link
Without that link, the CC BY 4.0 license requires you to credit the source somewhere else on the same page, for example in your footer: "BCV Today (bcv.today)". [How to give credit](https://bcv.today/en/license/#attribution).

### Preview

### Code for your page

```
`<script type="module" src="https://bcv.today/widget/v1.js"></script>
<bcv-rate></bcv-rate>`
```

Add the `<script>` tag only once per page, even if you use several widgets.

## Reference

### Attributes

All of them can be changed at any time and the widget updates.

Attribute | Values | Default |

`currency` | `USD`, `EUR`, `CNY`, `TRY`, `RUB` | `USD` |

`variant` | `card`, `line` (inline pill inside a sentence), `converter` (amount input to bolivars) | `card` |

`lang` | `es`, `en` | The closest `lang` attribute on the page (`en*` is English), else `es` |

`theme` | `auto` (follows `prefers-color-scheme`), `light`, `dark` | `auto` |

`amount` | The converter's initial amount, a plain number such as `100` or `1234.5` | `1` |

`hide-source` | Boolean: hides the "Source: BCV Today" link | Shown |

`api` | Data origin, for tests or a mirror | `https://bcv.today` |

Numbers follow the language: Spanish uses the Venezuelan format (`916,6477`, `1.007,3867`), English the US format (`916.6477`, `1,007.3867`). Rates have 4 decimals and converted amounts 2. The converter accepts amounts such as `1.234,5` or `1234.5`.

### CSS custom properties

Set them on the element or any ancestor. `--bcv-bg` and `--bcv-text` replace both the light and the dark value, so choose a pair with enough contrast or set them per theme.

Property | Default (light / dark) |

`--bcv-accent` | `#f2b33d`, the gold of the BCV Today mark (logo and focused input border) |

`--bcv-bg` | `#fdfbf7` / `#1c1a18` |

`--bcv-text` | `#1f1b16` / `#efe9de` |

`--bcv-radius` | `12px` (card and converter); the inline pill is fully rounded unless set |

`--bcv-font` | System UI font (the inline variant inherits the surrounding font); numbers are always monospace |

### Parts (`::part()`)

The widget uses Shadow DOM: your CSS does not leak in and its CSS does not leak out. To style specific pieces use `bcv-rate::part(name)` with these parts: `container`, `label`, `value`, `change`, `date`, `note` (cached notice), `source`, `mark`, `status` (loading and error text) and, in the converter, `input` and `result`.

```
`bcv-rate {
  --bcv-radius: 4px;
  --bcv-font: "Inter", sans-serif;
}
bcv-rate::part(value) {
  font-weight: 700;
}`
```

### Events

The widget does not fire events of its own. In the converter, the amount field is a regular `<input>` inside the Shadow DOM.

### Good to know

- **No cookies, no tracking.** It only keeps the last good rate in the browser's `localStorage`, to show it when the API is unreachable (with a "Cached value" notice).
- **Reads public data only.** It requests `https://bcv.today/api/v1/rate.json` and the daily history files to work out the change. Every widget on the page shares the same requests, refreshed every 30 minutes while the page is visible.
- **Works with a strict CSP.** The markup is built with DOM APIs, never by parsing HTML, so `script-src https://bcv.today` and `connect-src https://bcv.today` are enough; it also works with Trusted Types.
- **Small.** About 5 KB min+gzip, with no dependencies.
- **Accessible.** Real text (no images of numbers), an accessible name such as "BCV rate: US dollar (USD)", the change direction spelled out for screen readers and a contrast of at least 4.5:1 in both themes.

Other ways to use the rate: [all integrations](https://bcv.today/en/integrations/) and the [API documentation](https://bcv.today/en/api/). Widget source code on [GitHub](https://github.com/grupoclip/bcv-api/tree/main/packages/widget).

```json
{
            "@context": "https://schema.org",
            "@type": "Organization",
            "@id": "https://bcv.today/#organization",
            "name": "BCV Today",
            "url": "https://bcv.today/",
            "logo": "https://bcv.today/assets/icon-512.png",
            "sameAs": [
                "https://github.com/grupoclip/bcv-api"
            ]
        }
{
            "@context": "https://schema.org",
            "@type": "WebSite",
            "@id": "https://bcv.today/#website",
            "name": "BCV Today",
            "alternateName": [
                "BCVHoy",
                "BCV hoy"
            ],
            "url": "https://bcv.today/",
            "description": "Tasas oficiales del Banco Central de Venezuela, hoy. USD, EUR, CNY, TRY y RUB contra el bolívar, actualizadas a diario.",
            "inLanguage": [
                "es-VE",
                "en-US"
            ],
            "publisher": {
                "@id": "https://bcv.today/#organization"
            },
            "potentialAction": {
                "@type": "SearchAction",
                "target": "https://bcv.today/en/history/?c={search_term_string}",
                "query-input": "required name=search_term_string"
            }
        }
{
            "@context": "https://schema.org",
            "@type": "WebPage",
            "@id": "https://bcv.today/en/widget/#webpage",
            "url": "https://bcv.today/en/widget/",
            "name": "BCV rate widget | The BCV dollar on your website, free",
            "description": "Show today&#39;s official BCV rate on any website with one line of code, free. Configure the widget (card, inline or converter), see it live and copy the HTML.",
            "isPartOf": {
                "@id": "https://bcv.today/#website"
            },
            "publisher": {
                "@id": "https://bcv.today/#organization"
            },
            "inLanguage": "en-US"
        }
{
            "@context": "https://schema.org",
            "@type": "BreadcrumbList",
            "@id": "https://bcv.today/en/widget/#breadcrumb",
            "itemListElement": [
                {
                    "@type": "ListItem",
                    "position": 1,
                    "name": "BCV Today",
                    "item": "https://bcv.today/en/"
                },
                {
                    "@type": "ListItem",
                    "position": 2,
                    "name": "BCV rate widget | The BCV dollar on your website, free",
                    "item": "https://bcv.today/en/widget/"
                }
            ]
        }
```
