# Tipo de cambio SUNAT

La información se actualiza de forma diaria 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.

## GET /tipo-cambio/sunat

> Consulta tipo de cambio por fecha SUNAT

```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"}}}}},"paths":{"/tipo-cambio/sunat":{"get":{"summary":"Consulta tipo de cambio por fecha SUNAT","tags":["tipo-cambio"],"parameters":[{"$ref":"#/components/parameters/AcceptJsonParam"},{"name":"fecha","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TipoCambio"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Forbidden"}}}},"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/sunat/ultimo

> Consulta último tipo de cambio SUNAT

```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"}}}}},"paths":{"/tipo-cambio/sunat/ultimo":{"get":{"summary":"Consulta último tipo de cambio SUNAT","tags":["tipo-cambio"],"parameters":[{"$ref":"#/components/parameters/AcceptJsonParam"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TipoCambio"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Forbidden"}}}},"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/sunat/historico

> Consulta tipo de cambio por rango de fecha SUNAT

```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"}}}}},"paths":{"/tipo-cambio/sunat/historico":{"get":{"summary":"Consulta tipo de cambio por rango de fecha SUNAT","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"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TipoCambioCollection"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Forbidden"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnprocessableContent"}}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.migo.pe/v2/tipo-de-cambio/tipo-de-cambio-sunat.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
