{"openapi":"3.1.0","info":{"title":"1AM Explorer API","version":"1.0.0","description":"Native 1AM-powered API for Midnight mainnet, preprod, and preview network stats, designed for apps, dashboards, AI agents, and ecosystem integrations."},"servers":[{"url":"https://explorer.1am.xyz"}],"externalDocs":{"description":"AI skill for using the 1AM Explorer API","url":"https://explorer.1am.xyz/api/ai-skill.md"},"tags":[{"name":"Midnight Networks","description":"Midnight mainnet, preprod, and preview network overview and detail endpoints."}],"paths":{"/api/v1/{network}/summary":{"get":{"tags":["Midnight Networks"],"summary":"Get full Midnight network summary","description":"Returns all homepage-ready Midnight metrics for mainnet, preprod, or preview in one response.","parameters":[{"name":"network","in":"path","required":true,"schema":{"type":"string","enum":["mainnet","preprod","preview"]},"description":"Midnight network id."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}},"500":{"description":"Upstream or server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/api/v1/{network}/latest-block":{"get":{"tags":["Midnight Networks"],"summary":"Get latest block","description":"Returns latest block height, hash, timestamp, age, and protocol version.","parameters":[{"name":"network","in":"path","required":true,"schema":{"type":"string","enum":["mainnet","preprod","preview"]},"description":"Midnight network id."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}},"500":{"description":"Upstream or server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/api/v1/{network}/block-time":{"get":{"tags":["Midnight Networks"],"summary":"Get block time","description":"Returns recent average block time over the latest sampled block intervals.","parameters":[{"name":"network","in":"path","required":true,"schema":{"type":"string","enum":["mainnet","preprod","preview"]},"description":"Midnight network id."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}},"500":{"description":"Upstream or server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/api/v1/{network}/blocks-produced":{"get":{"tags":["Midnight Networks"],"summary":"Get blocks produced","description":"Returns total produced blocks and estimated hourly/daily production from recent cadence.","parameters":[{"name":"network","in":"path","required":true,"schema":{"type":"string","enum":["mainnet","preprod","preview"]},"description":"Midnight network id."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}},"500":{"description":"Upstream or server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/api/v1/{network}/uptime":{"get":{"tags":["Midnight Networks"],"summary":"Get uptime signal","description":"Returns derived health based on latest block freshness and current epoch utilization.","parameters":[{"name":"network","in":"path","required":true,"schema":{"type":"string","enum":["mainnet","preprod","preview"]},"description":"Midnight network id."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}},"500":{"description":"Upstream or server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/api/v1/{network}/epoch":{"get":{"tags":["Midnight Networks"],"summary":"Get epoch progress","description":"Returns current epoch number, duration, elapsed time, remaining time, and progress.","parameters":[{"name":"network","in":"path","required":true,"schema":{"type":"string","enum":["mainnet","preprod","preview"]},"description":"Midnight network id."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}},"500":{"description":"Upstream or server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/api/v1/{network}/d-parameter":{"get":{"tags":["Midnight Networks"],"summary":"Get D-parameter","description":"Returns the latest Midnight D-parameter snapshot exposed by the indexer.","parameters":[{"name":"network","in":"path","required":true,"schema":{"type":"string","enum":["mainnet","preprod","preview"]},"description":"Midnight network id."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}},"500":{"description":"Upstream or server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/api/v1/{network}/night-supply":{"get":{"tags":["Midnight Networks"],"summary":"Get NIGHT supply","description":"Returns official NIGHT total supply metadata with source attribution.","parameters":[{"name":"network","in":"path","required":true,"schema":{"type":"string","enum":["mainnet","preprod","preview"]},"description":"Midnight network id."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}},"500":{"description":"Upstream or server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/api/v1/{network}/search":{"get":{"tags":["Midnight Networks"],"summary":"Search network data","description":"Resolves block heights, transaction hashes, contract addresses, and public identifier hex values.","parameters":[{"name":"network","in":"path","required":true,"schema":{"type":"string","enum":["mainnet","preprod","preview"]},"description":"Midnight network id."},{"name":"q","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}},"500":{"description":"Upstream or server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/api/v1/{network}/recent-transactions":{"get":{"tags":["Midnight Networks"],"summary":"Get recent transactions","description":"Returns recent public transactions for feeds, tables, and activity surfaces.","parameters":[{"name":"network","in":"path","required":true,"schema":{"type":"string","enum":["mainnet","preprod","preview"]},"description":"Midnight network id."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}},"500":{"description":"Upstream or server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/api/v1/{network}/block":{"get":{"tags":["Midnight Networks"],"summary":"Get block detail","description":"Returns block detail by height, including parent, author, system parameters, and transactions.","parameters":[{"name":"network","in":"path","required":true,"schema":{"type":"string","enum":["mainnet","preprod","preview"]},"description":"Midnight network id."},{"name":"height","in":"query","required":true,"schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}},"500":{"description":"Upstream or server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/api/v1/{network}/transaction":{"get":{"tags":["Midnight Networks"],"summary":"Get transaction detail","description":"Returns transaction detail by hash, including fees, status, identifiers, contract actions, UTXOs, and ledger events.","parameters":[{"name":"network","in":"path","required":true,"schema":{"type":"string","enum":["mainnet","preprod","preview"]},"description":"Midnight network id."},{"name":"hash","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}},"500":{"description":"Upstream or server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/api/v1/{network}/contract":{"get":{"tags":["Midnight Networks"],"summary":"Get contract detail","description":"Returns latest contract action by address, including entry point, balances, state roots, and transaction context.","parameters":[{"name":"network","in":"path","required":true,"schema":{"type":"string","enum":["mainnet","preprod","preview"]},"description":"Midnight network id."},{"name":"address","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}},"500":{"description":"Upstream or server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/api/v1/{network}/address-activity":{"get":{"tags":["Midnight Networks"],"summary":"Get public address activity","description":"Returns public identifier activity across transactions and contracts.","parameters":[{"name":"network","in":"path","required":true,"schema":{"type":"string","enum":["mainnet","preprod","preview"]},"description":"Midnight network id."},{"name":"identifier","in":"query","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}},"500":{"description":"Upstream or server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}}}}}}}}},"components":{"schemas":{"NetworkSummary":{"type":"object","properties":{"network":{"type":"object"},"generatedAt":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["healthy","degraded"]},"latestBlock":{"type":"object"},"blockTime":{"type":"object"},"blocksProduced":{"type":"object"},"uptime":{"type":"object"},"epoch":{"type":["object","null"]},"dParameter":{"type":["object","null"]},"nightSupply":{"type":"object"}}}}}}