{"openapi":"3.0.3","info":{"title":"Logam Mulia API","description":"API harga emas dan logam mulia dari berbagai sumber di Indonesia. Data discrape secara real-time dan di-cache per hari.","version":"1.0.0"},"servers":[{"url":"http://localhost:8787","description":"Development"}],"tags":[{"name":"System","description":"Root & health check"},{"name":"Sources","description":"Daftar & harga dari sumber logam mulia"},{"name":"History","description":"Riwayat harga"},{"name":"News","description":"Berita logam mulia"}],"components":{"schemas":{"PriceItem":{"type":"object","properties":{"source":{"type":"string","example":"anekalogam"},"material":{"type":"string","example":"gold"},"materialType":{"type":"string","example":"Antam"},"weight":{"type":"number","example":1},"weightUnit":{"type":"string","example":"gr"},"sellPrice":{"type":"number","example":2700000},"buybackPrice":{"type":"number","nullable":true,"example":2650000},"currency":{"type":"string","example":"IDR"},"recordedDate":{"type":"string","example":"2026-05-16"},"lineKey":{"type":"string","example":""},"url":{"type":"string","example":"/api/prices/anekalogam"},"displayName":{"type":"string","example":"Aneka Logam"},"logo":{"type":"string","example":""},"favicon":{"type":"string","nullable":true,"example":null},"cover":{"type":"string","nullable":true,"example":null},"urlHomepage":{"type":"string","example":"https://www.anekalogam.co.id"}},"required":["source","material","materialType","weight","weightUnit","sellPrice","buybackPrice","currency","recordedDate","lineKey"]},"PriceResponse":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/PriceItem"},"description":"Array of price items"},"count":{"type":"number","example":9},"timestamp":{"type":"string","example":"2026-05-16T05:06:58.888Z"},"cached":{"type":"boolean","example":true},"source":{"type":"string"},"currency":{"type":"string"}},"required":["success","timestamp"]},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"string","example":"Unknown error"},"timestamp":{"type":"string","example":"2026-05-16T05:06:58.888Z"}},"required":["success","error","timestamp"]},"NewsItem":{"type":"object","properties":{"source":{"type":"string","example":"detik"},"title":{"type":"string","example":"Harga emas naik tipis hari ini"},"url":{"type":"string","example":"https://finance.detik.com/..."},"publishedAt":{"type":"string","example":"2026-05-17T10:00:00Z"},"summary":{"type":"string"},"category":{"type":"string"},"displayName":{"type":"string","example":"Detik Finance"},"logo":{"type":"string"},"favicon":{"type":"string","nullable":true},"cover":{"type":"string","nullable":true},"urlHomepage":{"type":"string"}},"required":["source","title","url","publishedAt"]},"NewsResponse":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/NewsItem"}},"count":{"type":"number"},"timestamp":{"type":"string"},"cached":{"type":"boolean"}},"required":["success","timestamp"]},"SourceInfo":{"type":"object","properties":{"name":{"type":"string","example":"anekalogam"},"displayName":{"type":"string","example":"Aneka Logam"},"logo":{"type":"string"},"favicon":{"type":"string","nullable":true},"cover":{"type":"string","nullable":true},"url":{"type":"string","example":"/api/prices/anekalogam"},"urlHomepage":{"type":"string","example":"https://www.anekalogam.co.id"}},"required":["name","url"]},"HistoryItem":{"type":"object","properties":{"source":{"type":"string"},"material":{"type":"string"},"materialType":{"type":"string"},"weight":{"type":"number"},"weightUnit":{"type":"string"},"sellPrice":{"type":"number"},"buybackPrice":{"type":"number","nullable":true},"currency":{"type":"string"},"recordedDate":{"type":"string"},"createdAt":{"type":"string"},"lineKey":{"type":"string"},"url":{"type":"string","example":"/api/prices/anekalogam"},"displayName":{"type":"string","example":"Aneka Logam"},"logo":{"type":"string","example":""},"favicon":{"type":"string","nullable":true,"example":null},"cover":{"type":"string","nullable":true,"example":null},"urlHomepage":{"type":"string","example":"https://www.anekalogam.co.id"}},"required":["source","material","materialType","weight","weightUnit","sellPrice","buybackPrice","currency","recordedDate","createdAt","lineKey"]},"HistoryPagination":{"type":"object","properties":{"page":{"type":"number"},"length":{"type":"number"},"total":{"type":"number"},"totalPages":{"type":"number"}},"required":["page","length","total","totalPages"]},"HistoryResponse":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/HistoryItem"}},"pagination":{"$ref":"#/components/schemas/HistoryPagination"},"error":{"type":"string"}},"required":["success"]}},"parameters":{}},"paths":{"/api/prices/anekalogam":{"get":{"tags":["Sources"],"parameters":[{"schema":{"type":"string","enum":["true"],"description":"Force re-scrape, bypass cache harian"},"required":false,"name":"refresh","in":"query"}],"responses":{"200":{"description":"Data harga terkini","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceResponse"}}}},"500":{"description":"Gagal scrape","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/prices/bankbsi":{"get":{"tags":["Sources"],"parameters":[{"schema":{"type":"string","enum":["true"],"description":"Force re-scrape, bypass cache harian"},"required":false,"name":"refresh","in":"query"}],"responses":{"200":{"description":"Data harga terkini","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceResponse"}}}},"500":{"description":"Gagal scrape","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/prices/brankaslm":{"get":{"tags":["Sources"],"parameters":[{"schema":{"type":"string","enum":["true"],"description":"Force re-scrape, bypass cache harian"},"required":false,"name":"refresh","in":"query"}],"responses":{"200":{"description":"Data harga terkini","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceResponse"}}}},"500":{"description":"Gagal scrape","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/prices/cermati":{"get":{"tags":["Sources"],"parameters":[{"schema":{"type":"string","enum":["true"],"description":"Force re-scrape, bypass cache harian"},"required":false,"name":"refresh","in":"query"}],"responses":{"200":{"description":"Data harga terkini","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceResponse"}}}},"500":{"description":"Gagal scrape","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/prices/emasku":{"get":{"tags":["Sources"],"parameters":[{"schema":{"type":"string","enum":["true"],"description":"Force re-scrape, bypass cache harian"},"required":false,"name":"refresh","in":"query"}],"responses":{"200":{"description":"Data harga terkini","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceResponse"}}}},"500":{"description":"Gagal scrape","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/prices/galeri24":{"get":{"tags":["Sources"],"parameters":[{"schema":{"type":"string","enum":["true"],"description":"Force re-scrape, bypass cache harian"},"required":false,"name":"refresh","in":"query"}],"responses":{"200":{"description":"Data harga terkini","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceResponse"}}}},"500":{"description":"Gagal scrape","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/prices/hargaemas-com":{"get":{"tags":["Sources"],"parameters":[{"schema":{"type":"string","enum":["true"],"description":"Force re-scrape, bypass cache harian"},"required":false,"name":"refresh","in":"query"}],"responses":{"200":{"description":"Data harga terkini","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceResponse"}}}},"500":{"description":"Gagal scrape","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/prices/hargaemas-net":{"get":{"tags":["Sources"],"parameters":[{"schema":{"type":"string","enum":["true"],"description":"Force re-scrape, bypass cache harian"},"required":false,"name":"refresh","in":"query"}],"responses":{"200":{"description":"Data harga terkini","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceResponse"}}}},"500":{"description":"Gagal scrape","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/prices/hargaemas-org":{"get":{"tags":["Sources"],"parameters":[{"schema":{"type":"string","enum":["true"],"description":"Force re-scrape, bypass cache harian"},"required":false,"name":"refresh","in":"query"}],"responses":{"200":{"description":"Data harga terkini","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceResponse"}}}},"500":{"description":"Gagal scrape","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/prices/hartadinataabadi":{"get":{"tags":["Sources"],"parameters":[{"schema":{"type":"string","enum":["true"],"description":"Force re-scrape, bypass cache harian"},"required":false,"name":"refresh","in":"query"}],"responses":{"200":{"description":"Data harga terkini","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceResponse"}}}},"500":{"description":"Gagal scrape","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/prices/indogold":{"get":{"tags":["Sources"],"parameters":[{"schema":{"type":"string","enum":["true"],"description":"Force re-scrape, bypass cache harian"},"required":false,"name":"refresh","in":"query"}],"responses":{"200":{"description":"Data harga terkini","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceResponse"}}}},"500":{"description":"Gagal scrape","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/prices/kursdolar":{"get":{"tags":["Sources"],"parameters":[{"schema":{"type":"string","enum":["true"],"description":"Force re-scrape, bypass cache harian"},"required":false,"name":"refresh","in":"query"}],"responses":{"200":{"description":"Data harga terkini","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceResponse"}}}},"500":{"description":"Gagal scrape","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/prices/lakuemas":{"get":{"tags":["Sources"],"parameters":[{"schema":{"type":"string","enum":["true"],"description":"Force re-scrape, bypass cache harian"},"required":false,"name":"refresh","in":"query"}],"responses":{"200":{"description":"Data harga terkini","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceResponse"}}}},"500":{"description":"Gagal scrape","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/prices/logammulia":{"get":{"tags":["Sources"],"parameters":[{"schema":{"type":"string","enum":["true"],"description":"Force re-scrape, bypass cache harian"},"required":false,"name":"refresh","in":"query"}],"responses":{"200":{"description":"Data harga terkini","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceResponse"}}}},"500":{"description":"Gagal scrape","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/prices/pegadaian":{"get":{"tags":["Sources"],"parameters":[{"schema":{"type":"string","enum":["true"],"description":"Force re-scrape, bypass cache harian"},"required":false,"name":"refresh","in":"query"}],"responses":{"200":{"description":"Data harga terkini","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceResponse"}}}},"500":{"description":"Gagal scrape","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/prices/sakumas":{"get":{"tags":["Sources"],"parameters":[{"schema":{"type":"string","enum":["true"],"description":"Force re-scrape, bypass cache harian"},"required":false,"name":"refresh","in":"query"}],"responses":{"200":{"description":"Data harga terkini","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceResponse"}}}},"500":{"description":"Gagal scrape","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/prices/sampoernagold":{"get":{"tags":["Sources"],"parameters":[{"schema":{"type":"string","enum":["true"],"description":"Force re-scrape, bypass cache harian"},"required":false,"name":"refresh","in":"query"}],"responses":{"200":{"description":"Data harga terkini","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceResponse"}}}},"500":{"description":"Gagal scrape","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/prices/treasury":{"get":{"tags":["Sources"],"parameters":[{"schema":{"type":"string","enum":["true"],"description":"Force re-scrape, bypass cache harian"},"required":false,"name":"refresh","in":"query"}],"responses":{"200":{"description":"Data harga terkini","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceResponse"}}}},"500":{"description":"Gagal scrape","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/news/investor-id":{"get":{"tags":["News"],"responses":{"200":{"description":"Data berita terkini","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewsResponse"}}}},"500":{"description":"Gagal scrape","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/news/investor-id/detail":{"get":{"tags":["News"],"parameters":[{"schema":{"type":"string","description":"URL artikel yang akan di-scrape"},"required":true,"name":"url","in":"query"}],"responses":{"200":{"description":"Detail berita","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewsResponse"}}}},"400":{"description":"Missing url parameter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Gagal scrape","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/news":{"get":{"tags":["News"],"responses":{"200":{"description":"Daftar sumber berita yang tersedia","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SourceInfo"}}},"required":["data"]}}}}}}},"/api/prices":{"get":{"tags":["Sources"],"responses":{"200":{"description":"Daftar sumber yang tersedia","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SourceInfo"}}},"required":["data"]}}}}}}},"/api/prices/{source}/history":{"get":{"tags":["History"],"parameters":[{"schema":{"type":"string","description":"Nama sumber"},"required":true,"name":"source","in":"path"},{"schema":{"type":"string","description":"Nomor halaman (default 1)"},"required":false,"name":"page","in":"query"},{"schema":{"type":"string","description":"Item per halaman (default 20, max 1000)"},"required":false,"name":"length","in":"query"},{"schema":{"type":"string","description":"Filter berat (gram)"},"required":false,"name":"weight","in":"query"},{"schema":{"type":"string","description":"Filter material (e.g. gold, silver)"},"required":false,"name":"material","in":"query"},{"schema":{"type":"string","description":"Filter tipe material (e.g. Antam, UBS)"},"required":false,"name":"materialType","in":"query"}],"responses":{"200":{"description":"Riwayat harga","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HistoryResponse"}}}},"400":{"description":"Parameter tidak valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Source tidak dikenal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}