The present invention relates to a data query method and apparatus, and an electronic device, and belongs to the technical field of information processing. The method comprises: obtaining a query condition of a user, wherein the query condition comprises at least one or more of a block height, a block address, transaction information, a transaction amount and a transaction time of a to-be-queriedblock; generating a query index based on the query condition, wherein the query index is used to query the storage location of the to-be-queried block; and querying the to-be-queried block according to the query index to obtain block data of the to-be-queried block. According to the technical scheme of the present invention, by obtaining at least one or more query conditions of a block height, a block address, transaction information, a transaction amount, and a transaction time of a to-be-queried block to generate a query index, and querying the to-be-queried block according to the query index to obtain block data of the to-be-queried block, the block data can be queried according to multiple query conditions, the limitation of the data query is small, the process of data query is simplified, the intelligence is superior, and the user viscosity is high.