> For the complete documentation index, see [llms.txt](https://docs.migo.pe/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.migo.pe/v2/tipo-de-cambio/tipo-de-cambio-sbs.md).

# Tipo de cambio SBS

La información se actualiza todos los días hábiles entre las 00:00 y 06:00 horas (GMT-5) debido a la disponibilidad variable de las fuentes oficiales.

Puede consultar información del año 2010 en adelante.

### Monedas disponibles

| Moneda             | Código |
| ------------------ | ------ |
| Dólares Americanos | USD    |
| Euro               | EUR    |

## GET /tipo-cambio/sbs

> Consulta tipo de cambio por fecha SBS

```json
{"openapi":"3.0.2","info":{"title":"MIGO API","version":"2.0"},"tags":[{"name":"tipo-cambio"}],"servers":[{"url":"https://api.migo.pe/api/v2"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"parameters":{"AcceptJsonParam":{"name":"Accept","in":"header","required":true,"schema":{"type":"string"}}},"schemas":{"TipoCambio":{"type":"object","properties":{"success":{"type":"boolean"},"fecha":{"type":"string"},"moneda":{"type":"string"},"precio_compra":{"type":"string"},"precio_venta":{"type":"string"}}},"Forbidden":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}},"NotFound":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}},"UnprocessableContent":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"errors":{"type":"object"}}}},"responses":{"ForbiddenResponse":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Forbidden"}}}}}},"paths":{"/tipo-cambio/sbs":{"get":{"summary":"Consulta tipo de cambio por fecha SBS","tags":["tipo-cambio"],"parameters":[{"$ref":"#/components/parameters/AcceptJsonParam"},{"name":"fecha","in":"query","required":true,"schema":{"type":"string"}},{"name":"moneda","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TipoCambio"}}}},"403":{"$ref":"#/components/responses/ForbiddenResponse"},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnprocessableContent"}}}}}}}}}
```

## GET /tipo-cambio/sbs/ultimo

> Consulta último tipo de cambio SBS

```json
{"openapi":"3.0.2","info":{"title":"MIGO API","version":"2.0"},"tags":[{"name":"tipo-cambio"}],"servers":[{"url":"https://api.migo.pe/api/v2"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"parameters":{"AcceptJsonParam":{"name":"Accept","in":"header","required":true,"schema":{"type":"string"}}},"schemas":{"TipoCambio":{"type":"object","properties":{"success":{"type":"boolean"},"fecha":{"type":"string"},"moneda":{"type":"string"},"precio_compra":{"type":"string"},"precio_venta":{"type":"string"}}},"Forbidden":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}},"NotFound":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}},"UnprocessableContent":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"errors":{"type":"object"}}}},"responses":{"ForbiddenResponse":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Forbidden"}}}}}},"paths":{"/tipo-cambio/sbs/ultimo":{"get":{"summary":"Consulta último tipo de cambio SBS","tags":["tipo-cambio"],"parameters":[{"$ref":"#/components/parameters/AcceptJsonParam"},{"name":"moneda","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TipoCambio"}}}},"403":{"$ref":"#/components/responses/ForbiddenResponse"},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnprocessableContent"}}}}}}}}}
```

## GET /tipo-cambio/sbs/historico

> Consulta tipo de cambio por rango de fecha SBS

```json
{"openapi":"3.0.2","info":{"title":"MIGO API","version":"2.0"},"tags":[{"name":"tipo-cambio"}],"servers":[{"url":"https://api.migo.pe/api/v2"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"parameters":{"AcceptJsonParam":{"name":"Accept","in":"header","required":true,"schema":{"type":"string"}}},"schemas":{"TipoCambioCollection":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/TipoCambioCollectionItem"}}}},"TipoCambioCollectionItem":{"type":"object","properties":{"fecha":{"type":"string"},"moneda":{"type":"string"},"precio_compra":{"type":"string"},"precio_venta":{"type":"string"}}},"Forbidden":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}},"NotFound":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}},"UnprocessableContent":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"errors":{"type":"object"}}}},"responses":{"ForbiddenResponse":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Forbidden"}}}}}},"paths":{"/tipo-cambio/sbs/historico":{"get":{"summary":"Consulta tipo de cambio por rango de fecha SBS","tags":["tipo-cambio"],"parameters":[{"$ref":"#/components/parameters/AcceptJsonParam"},{"name":"fecha_inicio","in":"query","required":true,"schema":{"type":"string"}},{"name":"fecha_fin","in":"query","required":true,"schema":{"type":"string"}},{"name":"moneda","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TipoCambioCollection"}}}},"403":{"$ref":"#/components/responses/ForbiddenResponse"},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnprocessableContent"}}}}}}}}}
```
