{
  "openapi": "3.0.0",
  "info": {
    "title": "Block Timestamp Lookup API",
    "description": "Retrieve block(s) by timestamp or range of timestamps, simplifying blockchain data tracking and analysis.",
    "version": "1.0.0",
    "contact": {
      "email": "support@quicknode.com",
      "url": "https://support.quicknode.com/"
    }
  },
  "servers": [
    {
      "url": "https://{quicknode_endpoint}",
      "description": "Your Quicknode endpoint",
      "variables": {
        "quicknode_endpoint": {
          "default": "your-endpoint.quiknode.pro",
          "description": "Your Quicknode endpoint URL"
        }
      }
    }
  ],
  "tags": [
    {
      "name": "JSON-RPC",
      "description": "See request body examples for the available methods you can call on this add-on"
    }
  ],
  "paths": {
    "/rpc": {
      "post": {
        "summary": "JSON-RPC methods for https://block-timestamp-lookup-addon-ab019a71f178.herokuapp.com/rpc",
        "description": "Available methods:\n• qn_getBlockFromTimestamp: Retrieves the most recent block at or before a given timestamp.\n• qn_getBlocksInTimestampRange: Retrieves all blocks within a given timestamp range for a specified blockchain.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "jsonrpc": {
                        "type": "string",
                        "enum": [
                          "2.0"
                        ]
                      },
                      "method": {
                        "type": "string",
                        "enum": [
                          "qn_getBlockFromTimestamp"
                        ]
                      },
                      "id": {
                        "type": "integer",
                        "example": 1
                      },
                      "params": {
                        "type": "array",
                        "description": "Positional parameters",
                        "items": {
                          "description": "Parameter value (can be string, number, boolean, object, etc.)"
                        },
                        "example": [
                          1730000000
                        ]
                      }
                    },
                    "required": [
                      "jsonrpc",
                      "method",
                      "id",
                      "params"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "jsonrpc": {
                        "type": "string",
                        "enum": [
                          "2.0"
                        ]
                      },
                      "method": {
                        "type": "string",
                        "enum": [
                          "qn_getBlocksInTimestampRange"
                        ]
                      },
                      "id": {
                        "type": "integer",
                        "example": 1
                      },
                      "params": {
                        "type": "array",
                        "description": "Positional parameters",
                        "items": {
                          "description": "Parameter value (can be string, number, boolean, object, etc.)"
                        },
                        "example": [
                          1730000000,
                          1730000100
                        ]
                      }
                    },
                    "required": [
                      "jsonrpc",
                      "method",
                      "id",
                      "params"
                    ]
                  }
                ],
                "discriminator": {
                  "propertyName": "method"
                }
              },
              "examples": {
                "qn_getBlockFromTimestamp": {
                  "summary": "Retrieves the most recent block at or before a given timestamp.",
                  "value": {
                    "jsonrpc": "2.0",
                    "method": "qn_getBlockFromTimestamp",
                    "id": 1,
                    "params": [
                      1730000000
                    ]
                  }
                },
                "qn_getBlocksInTimestampRange": {
                  "summary": "Retrieves all blocks within a given timestamp range for a specified blockchain.",
                  "value": {
                    "jsonrpc": "2.0",
                    "method": "qn_getBlocksInTimestampRange",
                    "id": 1,
                    "params": [
                      1730000000,
                      1730000100
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "jsonrpc": {
                      "type": "string",
                      "enum": [
                        "2.0"
                      ]
                    },
                    "id": {
                      "type": "integer"
                    },
                    "result": {
                      "description": "Method result"
                    },
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "integer"
                        },
                        "message": {
                          "type": "string"
                        },
                        "data": {
                          "description": "Additional error data"
                        }
                      }
                    }
                  },
                  "required": [
                    "jsonrpc",
                    "id"
                  ]
                }
              }
            }
          }
        },
        "externalDocs": {
          "url": "https://www.quicknode.com/docs/ethereum/qn_getBlockFromTimestamp",
          "description": "Documentation: qn_getBlockFromTimestamp: https://www.quicknode.com/docs/ethereum/qn_getBlockFromTimestamp, qn_getBlocksInTimestampRange: https://www.quicknode.com/docs/ethereum/qn_getBlocksInTimestampRange"
        },
        "tags": [
          "JSON-RPC"
        ]
      }
    }
  },
  "externalDocs": {
    "description": "Support Documentation",
    "url": "https://support.quicknode.com/"
  }
}