{"openapi":"3.1.0","info":{"title":"Sismo Abierto API","version":"0.1.0","description":"API comunitaria sobre datos públicos del IGP. Proyecto comunitario, no oficial. Fuente de datos: Instituto Geofísico del Perú. No es un sistema de alerta ni de predicción."},"servers":[{"url":"/api"}],"paths":{"/v1/events/latest":{"get":{"summary":"Último sismo oficial","description":"Último evento publicado por el IGP (ArcGIS, con fallback WFS), normalizado con procedencia y frescura.","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LatestEventResponse"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/events":{"get":{"summary":"Catálogo de eventos","description":"Catálogo CENSIS filtrable por fecha y magnitud. La consulta se hace en origen; no se redistribuye el dataset.","parameters":[{"name":"since","in":"query","required":false,"description":"Fecha inicial ISO o duración tipo 7d","schema":{"type":"string"}},{"name":"until","in":"query","required":false,"description":"Fecha final ISO","schema":{"type":"string"}},{"name":"minMagnitude","in":"query","required":false,"description":"Magnitud mínima","schema":{"type":"number"}},{"name":"maxMagnitude","in":"query","required":false,"description":"Magnitud máxima","schema":{"type":"number"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventListResponse"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/events/{eventId}":{"get":{"summary":"Detalle de un evento","description":"Evento normalizado con procedencia por campo.","parameters":[{"name":"eventId","in":"path","required":true,"description":"ID interno estable del evento","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventDetailResponse"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/events/{eventId}/stations":{"get":{"summary":"Estaciones que registraron el evento","description":"Estaciones ACELDAT (acelerométricas y sísmicas) asociadas al reporte del evento.","parameters":[{"name":"eventId","in":"path","required":true,"description":"ID interno estable del evento","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StationListResponse"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/events/{eventId}/stations/{stationId}/waveform":{"get":{"summary":"Ondas de una estación","description":"Componentes Z, N y E con métricas calculadas sobre la serie completa y reducción solo para visualización.","parameters":[{"name":"eventId","in":"path","required":true,"description":"ID interno estable del evento","schema":{"type":"string"}},{"name":"stationId","in":"path","required":true,"description":"Código de estación, por ejemplo SCHYO","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaveformResponse"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/volcanoes":{"get":{"summary":"Volcanes publicados","description":"Los 16 registros publicados por la IDE del IGP. La fuente no expone fecha por registro: freshness es FRESHNESS_UNKNOWN.","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VolcanoListResponse"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/volcanoes/{slug}":{"get":{"summary":"Ficha de un volcán","description":"Registro publicado con procedencia y frescura explícita.","parameters":[{"name":"slug","in":"path","required":true,"description":"Slug del volcán, por ejemplo sabancaya","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VolcanoDetailResponse"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/sources":{"get":{"summary":"Estado observado de las fuentes","description":"Lo que observó nuestro consumidor sobre las fuentes públicas. No representa el estado interno del IGP.","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourcesResponse"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/sources/{sourceId}":{"get":{"summary":"Historial observado de una fuente","description":"Chequeos recientes y evidencia de una fuente pública.","parameters":[{"name":"sourceId","in":"path","required":true,"description":"ID de la fuente, por ejemplo igp-aceldat","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceDetailResponse"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}},"components":{"schemas":{"ApiError":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["SOURCE_UNAVAILABLE","SOURCE_SCHEMA_CHANGED","NOT_FOUND","INVALID_INPUT","INTERNAL"]},"message":{"type":"string"},"sourceId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","sourceId"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"LatestEventResponse":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"event":{"type":"object","properties":{"id":{"type":"string"},"timeUtc":{"anyOf":[{"type":"string"},{"type":"null"}]},"timeLocal":{"anyOf":[{"type":"string"},{"type":"null"}]},"magnitude":{"type":"number"},"depthKm":{"type":"number"},"latitude":{"type":"number"},"longitude":{"type":"number"},"reference":{"anyOf":[{"type":"string"},{"type":"null"}]},"intensity":{"anyOf":[{"type":"string"},{"type":"null"}]},"aceldatReportNumber":{"anyOf":[{"type":"number"},{"type":"null"}]},"provenance":{"type":"object","properties":{"source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"}},"required":["id","name","url"],"additionalProperties":false},"fetchedAt":{"type":"string"},"timezone":{"type":"string"},"sourceUpdatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"freshness":{"type":"string","enum":["FRESH","STALE","FRESHNESS_UNKNOWN"]},"classification":{"type":"string","enum":["official","derived","explanation","unavailable"]},"note":{"type":"string"}},"required":["source","fetchedAt","timezone","sourceUpdatedAt","freshness","classification"],"additionalProperties":false},"fieldClasses":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","enum":["official","derived","explanation","unavailable"]}}},"required":["id","timeUtc","timeLocal","magnitude","depthKm","latitude","longitude","reference","intensity","aceldatReportNumber","provenance","fieldClasses"],"additionalProperties":false},"limitations":{"type":"array","items":{"type":"string"}}},"required":["event","limitations"],"additionalProperties":false},"EventListResponse":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"timeUtc":{"anyOf":[{"type":"string"},{"type":"null"}]},"timeLocal":{"anyOf":[{"type":"string"},{"type":"null"}]},"magnitude":{"type":"number"},"depthKm":{"type":"number"},"latitude":{"type":"number"},"longitude":{"type":"number"},"reference":{"anyOf":[{"type":"string"},{"type":"null"}]},"intensity":{"anyOf":[{"type":"string"},{"type":"null"}]},"aceldatReportNumber":{"anyOf":[{"type":"number"},{"type":"null"}]},"provenance":{"type":"object","properties":{"source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"}},"required":["id","name","url"],"additionalProperties":false},"fetchedAt":{"type":"string"},"timezone":{"type":"string"},"sourceUpdatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"freshness":{"type":"string","enum":["FRESH","STALE","FRESHNESS_UNKNOWN"]},"classification":{"type":"string","enum":["official","derived","explanation","unavailable"]},"note":{"type":"string"}},"required":["source","fetchedAt","timezone","sourceUpdatedAt","freshness","classification"],"additionalProperties":false},"fieldClasses":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","enum":["official","derived","explanation","unavailable"]}}},"required":["id","timeUtc","timeLocal","magnitude","depthKm","latitude","longitude","reference","intensity","aceldatReportNumber","provenance","fieldClasses"],"additionalProperties":false}},"filters":{"type":"object","properties":{"since":{"anyOf":[{"type":"string"},{"type":"null"}]},"until":{"anyOf":[{"type":"string"},{"type":"null"}]},"minMagnitude":{"anyOf":[{"type":"number"},{"type":"null"}]},"maxMagnitude":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["since","until","minMagnitude","maxMagnitude"],"additionalProperties":false},"provenance":{"type":"object","properties":{"source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"}},"required":["id","name","url"],"additionalProperties":false},"fetchedAt":{"type":"string"},"timezone":{"type":"string"},"sourceUpdatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"freshness":{"type":"string","enum":["FRESH","STALE","FRESHNESS_UNKNOWN"]},"classification":{"type":"string","enum":["official","derived","explanation","unavailable"]},"note":{"type":"string"}},"required":["source","fetchedAt","timezone","sourceUpdatedAt","freshness","classification"],"additionalProperties":false},"limitations":{"type":"array","items":{"type":"string"}}},"required":["events","filters","provenance","limitations"],"additionalProperties":false},"EventDetailResponse":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"event":{"type":"object","properties":{"id":{"type":"string"},"timeUtc":{"anyOf":[{"type":"string"},{"type":"null"}]},"timeLocal":{"anyOf":[{"type":"string"},{"type":"null"}]},"magnitude":{"type":"number"},"depthKm":{"type":"number"},"latitude":{"type":"number"},"longitude":{"type":"number"},"reference":{"anyOf":[{"type":"string"},{"type":"null"}]},"intensity":{"anyOf":[{"type":"string"},{"type":"null"}]},"aceldatReportNumber":{"anyOf":[{"type":"number"},{"type":"null"}]},"provenance":{"type":"object","properties":{"source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"}},"required":["id","name","url"],"additionalProperties":false},"fetchedAt":{"type":"string"},"timezone":{"type":"string"},"sourceUpdatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"freshness":{"type":"string","enum":["FRESH","STALE","FRESHNESS_UNKNOWN"]},"classification":{"type":"string","enum":["official","derived","explanation","unavailable"]},"note":{"type":"string"}},"required":["source","fetchedAt","timezone","sourceUpdatedAt","freshness","classification"],"additionalProperties":false},"fieldClasses":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","enum":["official","derived","explanation","unavailable"]}}},"required":["id","timeUtc","timeLocal","magnitude","depthKm","latitude","longitude","reference","intensity","aceldatReportNumber","provenance","fieldClasses"],"additionalProperties":false},"limitations":{"type":"array","items":{"type":"string"}}},"required":["event","limitations"],"additionalProperties":false},"StationListResponse":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"eventId":{"type":"string"},"stations":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"network":{"type":"string"},"name":{"type":"string"},"latitude":{"type":"number"},"longitude":{"type":"number"},"kind":{"type":"string","enum":["acc","sis"]},"order":{"type":"number"},"epicentralDistanceKm":{"anyOf":[{"type":"number"},{"type":"null"}]},"hasWaveform":{"type":"boolean"},"officialPga":{"anyOf":[{"type":"object","properties":{"z":{"type":"number"},"n":{"type":"number"},"e":{"type":"number"}},"required":["z","n","e"],"additionalProperties":false},{"type":"null"}]},"provenance":{"type":"object","properties":{"source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"}},"required":["id","name","url"],"additionalProperties":false},"fetchedAt":{"type":"string"},"timezone":{"type":"string"},"sourceUpdatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"freshness":{"type":"string","enum":["FRESH","STALE","FRESHNESS_UNKNOWN"]},"classification":{"type":"string","enum":["official","derived","explanation","unavailable"]},"note":{"type":"string"}},"required":["source","fetchedAt","timezone","sourceUpdatedAt","freshness","classification"],"additionalProperties":false}},"required":["code","network","name","latitude","longitude","kind","order","epicentralDistanceKm","hasWaveform","officialPga","provenance"],"additionalProperties":false}},"provenance":{"type":"object","properties":{"source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"}},"required":["id","name","url"],"additionalProperties":false},"fetchedAt":{"type":"string"},"timezone":{"type":"string"},"sourceUpdatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"freshness":{"type":"string","enum":["FRESH","STALE","FRESHNESS_UNKNOWN"]},"classification":{"type":"string","enum":["official","derived","explanation","unavailable"]},"note":{"type":"string"}},"required":["source","fetchedAt","timezone","sourceUpdatedAt","freshness","classification"],"additionalProperties":false},"limitations":{"type":"array","items":{"type":"string"}}},"required":["eventId","stations","provenance","limitations"],"additionalProperties":false},"WaveformResponse":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"waveform":{"type":"object","properties":{"eventId":{"type":"string"},"stationId":{"type":"string"},"header":{"type":"object","properties":{"stationName":{"type":"string"},"stationCode":{"type":"string"},"stationLatitude":{"type":"number"},"stationLongitude":{"type":"number"},"eventDateLocal":{"type":"string"},"eventTimeLocal":{"type":"string"},"eventLatitude":{"type":"number"},"eventLongitude":{"type":"number"},"eventDepthKm":{"type":"number"},"eventMagnitude":{"type":"number"},"epicentralDistanceKm":{"type":"number"},"startTimeUtc":{"type":"string"},"sampleCount":{"type":"number"},"sampleRateHz":{"type":"number"},"units":{"type":"string"},"baselineCorrected":{"type":"boolean"},"pga":{"type":"object","properties":{"z":{"type":"number"},"n":{"type":"number"},"e":{"type":"number"}},"required":["z","n","e"],"additionalProperties":false}},"required":["stationName","stationCode","stationLatitude","stationLongitude","eventDateLocal","eventTimeLocal","eventLatitude","eventLongitude","eventDepthKm","eventMagnitude","epicentralDistanceKm","startTimeUtc","sampleCount","sampleRateHz","units","baselineCorrected","pga"],"additionalProperties":false},"computedPga":{"type":"object","properties":{"z":{"type":"number"},"n":{"type":"number"},"e":{"type":"number"}},"required":["z","n","e"],"additionalProperties":false},"computedOverFullSeries":{"type":"boolean"},"reducedComponents":{"type":"object","properties":{"z":{"type":"array","items":{"type":"number"}},"n":{"type":"array","items":{"type":"number"}},"e":{"type":"array","items":{"type":"number"}}},"required":["z","n","e"],"additionalProperties":false},"reductionFactor":{"type":"number"},"sourceFileUrl":{"type":"string"},"provenance":{"type":"object","properties":{"source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"}},"required":["id","name","url"],"additionalProperties":false},"fetchedAt":{"type":"string"},"timezone":{"type":"string"},"sourceUpdatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"freshness":{"type":"string","enum":["FRESH","STALE","FRESHNESS_UNKNOWN"]},"classification":{"type":"string","enum":["official","derived","explanation","unavailable"]},"note":{"type":"string"}},"required":["source","fetchedAt","timezone","sourceUpdatedAt","freshness","classification"],"additionalProperties":false}},"required":["eventId","stationId","header","computedPga","computedOverFullSeries","reducedComponents","reductionFactor","sourceFileUrl","provenance"],"additionalProperties":false},"limitations":{"type":"array","items":{"type":"string"}}},"required":["waveform","limitations"],"additionalProperties":false},"VolcanoListResponse":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"volcanoes":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"region":{"type":"string"},"latitude":{"type":"number"},"longitude":{"type":"number"},"publishedLevel":{"type":"string"},"publishedActivity":{"type":"string"},"publishedReview":{"type":"string"},"objectId":{"type":"number"},"provenance":{"type":"object","properties":{"source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"}},"required":["id","name","url"],"additionalProperties":false},"fetchedAt":{"type":"string"},"timezone":{"type":"string"},"sourceUpdatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"freshness":{"type":"string","enum":["FRESH","STALE","FRESHNESS_UNKNOWN"]},"classification":{"type":"string","enum":["official","derived","explanation","unavailable"]},"note":{"type":"string"}},"required":["source","fetchedAt","timezone","sourceUpdatedAt","freshness","classification"],"additionalProperties":false}},"required":["slug","name","region","latitude","longitude","publishedLevel","publishedActivity","publishedReview","objectId","provenance"],"additionalProperties":false}},"freshness":{"type":"string","const":"FRESHNESS_UNKNOWN"},"provenance":{"type":"object","properties":{"source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"}},"required":["id","name","url"],"additionalProperties":false},"fetchedAt":{"type":"string"},"timezone":{"type":"string"},"sourceUpdatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"freshness":{"type":"string","enum":["FRESH","STALE","FRESHNESS_UNKNOWN"]},"classification":{"type":"string","enum":["official","derived","explanation","unavailable"]},"note":{"type":"string"}},"required":["source","fetchedAt","timezone","sourceUpdatedAt","freshness","classification"],"additionalProperties":false},"limitations":{"type":"array","items":{"type":"string"}}},"required":["volcanoes","freshness","provenance","limitations"],"additionalProperties":false},"VolcanoDetailResponse":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"volcano":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"region":{"type":"string"},"latitude":{"type":"number"},"longitude":{"type":"number"},"publishedLevel":{"type":"string"},"publishedActivity":{"type":"string"},"publishedReview":{"type":"string"},"objectId":{"type":"number"},"provenance":{"type":"object","properties":{"source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"}},"required":["id","name","url"],"additionalProperties":false},"fetchedAt":{"type":"string"},"timezone":{"type":"string"},"sourceUpdatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"freshness":{"type":"string","enum":["FRESH","STALE","FRESHNESS_UNKNOWN"]},"classification":{"type":"string","enum":["official","derived","explanation","unavailable"]},"note":{"type":"string"}},"required":["source","fetchedAt","timezone","sourceUpdatedAt","freshness","classification"],"additionalProperties":false}},"required":["slug","name","region","latitude","longitude","publishedLevel","publishedActivity","publishedReview","objectId","provenance"],"additionalProperties":false},"freshness":{"type":"string","const":"FRESHNESS_UNKNOWN"},"limitations":{"type":"array","items":{"type":"string"}}},"required":["volcano","freshness","limitations"],"additionalProperties":false},"SourcesResponse":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"sources":{"type":"array","items":{"type":"object","properties":{"sourceId":{"type":"string"},"source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"}},"required":["id","name","url"],"additionalProperties":false},"status":{"type":"string","enum":["OPERATIONAL","DEGRADED","UNAVAILABLE","SCHEMA_CHANGED","FRESHNESS_UNKNOWN"]},"lastCheckAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"latencyMs":{"anyOf":[{"type":"number"},{"type":"null"}]},"disclaimer":{"type":"string"}},"required":["sourceId","source","status","lastCheckAt","latencyMs","disclaimer"],"additionalProperties":false}},"disclaimer":{"type":"string"}},"required":["sources","disclaimer"],"additionalProperties":false},"SourceDetailResponse":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"source":{"type":"object","properties":{"sourceId":{"type":"string"},"source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"}},"required":["id","name","url"],"additionalProperties":false},"status":{"type":"string","enum":["OPERATIONAL","DEGRADED","UNAVAILABLE","SCHEMA_CHANGED","FRESHNESS_UNKNOWN"]},"lastCheckAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"latencyMs":{"anyOf":[{"type":"number"},{"type":"null"}]},"disclaimer":{"type":"string"}},"required":["sourceId","source","status","lastCheckAt","latencyMs","disclaimer"],"additionalProperties":false},"recentChecks":{"type":"array","items":{"type":"object","properties":{"checkedAt":{"type":"string"},"status":{"type":"string","enum":["OPERATIONAL","DEGRADED","UNAVAILABLE","SCHEMA_CHANGED","FRESHNESS_UNKNOWN"]},"httpStatus":{"anyOf":[{"type":"number"},{"type":"null"}]},"durationMs":{"type":"number"},"evidence":{"type":"string"}},"required":["checkedAt","status","httpStatus","durationMs","evidence"],"additionalProperties":false}},"disclaimer":{"type":"string"}},"required":["source","recentChecks","disclaimer"],"additionalProperties":false}}}}