API Documentation


How to use

 

To invoke an API method, it should be made a GET request with params separated by slashes. The first param should be the method to invoke. The response is issue in JSON.

API ENDPOINT
https://localmonero.co/blocks/api
URI Request Format
https://localmonero.co/blocks/api/{method}/{param1}/{param2}
JSON Response Example
{
   "status":"ERROR",
   "error":"Block not found",
   "method":"get_block_header",
   "param_value":"s"
}

{get_stats}

 

:Request current coin stats

https://localmonero.co/blocks/api/get_stats

JSON Response

{
   "difficulty":857854576,
   "height":493168,
   "hashrate":14297576.266667,
   "current_emission":6892313564273197407,
   "last_reward":11019174126253,
   "last_timestamp":1427371888
}

{get_block_header}

 

:Request a given block header by height or hash

https://localmonero.co/blocks/api/get_block_header/{height}
https://localmonero.co/blocks/api/get_block_header/{hash}

JSON Response

{
   "block_header":{
      "depth":101635,
      "difficulty":42822738260,
      "hash":"1aad696889727fd2b00f571f9b116c6dcf8169457fb5554dee27258ab6ed772e",
      "height":5898,
      "major_version":1,
      "minor_version":0,
      "nonce":745838533,
      "orphan_status":false,
      "prev_hash":"90dbd09f741ba8c6871e066a557215cd8aaf9a99d07e0d92caa02f9df03c730c",
      "reward":134544907000000,
      "timestamp":1413485348
   },
   "status":"OK"
}

{get_block_data}

 

:Request a given block data by height or hash

https://localmonero.co/blocks/api/get_block_data/{height}
https://localmonero.co/blocks/api/get_block_data/{hash}

JSON Response

{
  "status": "OK",
  "block_data": {
    "id": "0",
    "jsonrpc": "2.0",
    "result": {
      "block_header": {
        "block_size": 92718,
        "block_weight": 92718,
        "cumulative_difficulty": 222782970004872906,
        "cumulative_difficulty_top64": 0,
        "depth": 29,
        "difficulty": 331169246949,
        "difficulty_top64": 0,
        "hash": "a7fa104288c42e0264a2c8a6df22df0cd4519bbf393e9f90836e57fe98ff4377",
        "height": 2711514,
        "long_term_weight": 176470,
        "major_version": 16,
        "miner_tx_hash": "0c5d97f78b0e3d3ddc541ed67e3af3eb5e7177c2d5f3ac38fdd0f1cb6b7f7566",
        "minor_version": 16,
        "nonce": 1076959528,
        "num_txes": 50,
        "orphan_status": false,
        "pow_hash": "",
        "prev_hash": "40826ecf0280dc1992d8d61ead84772ec3c6628c0c89652a026de55b07a07d10",
        "reward": 624691880000,
        "timestamp": 1663132990,
        "wide_cumulative_difficulty": "0x3177bee4d259eca",
        "wide_difficulty": "0x4d1b39aee5"
      },
      "credits": 0,
      "miner_tx_hash": "0c5d97f78b0e3d3ddc541ed67e3af3eb5e7177c2d5f3ac38fdd0f1cb6b7f7566",
      "status": "OK",
      "top_hash": "",
      "tx_hashes": [
        "1175cefe21547b04f22e985633b688b361da588b1be7c9623c005d775f3823ab",
        "4191e092e14e46fd6bb8ec19551e4aa8f42a1c6ae1e5e215dca7c00fc1b2776c",
        "a055345dd8f23ac7df5467204b5f7c5ba2c1f59d5ff77ae511ba139d2997cb91",
        "d707109ebb6b51817ef9dc11e1db68f7bf513a70fe8846ef9f639fd3f3f04e9a",
        "ae80fc7f2e188fc03ae4cd1c41d040e4885238f855a6eebf5b5da2a57186dd41",
        "e282e66c373e07b1afbe6bd6996570f423496e975fca953e836ecbc1a4060117",
        "1097f57518ee49781d7ec41e3744e04cfaffbb4a632cb80da9923df930edea0f",
        "2572db8ba52f9f975dfce50b69fd5e33a38c9fa0ef4a569f2a10b8cc8ae234d1",
        "e56f392eb019696cdd67f6a0ecb7b6da161d4efd2777403ff6331a331315bd7a",
        "6e14b201f949048e4e6494e0841b78a2f8e3d5dd85ee7744c019de2897ed3093",
        "03fd50b3db07e13dd17b0039e74f257b825fc226e343ed4a97b31e91769f9640",
        "3b85f5c46d6951b00e09f162c4594c3a2693a50dd58c9be3dddc165c1b73e320",
        "15fa02f49f0277de0589d5c5c0700f4e22d6959c7adca33406e9073ce4025a38",
        "71904c96a983c8257c7ddae4a5a39ad54252bafa40f1ed653c2ae7eb15c9ec3e",
        "f8633834885e52a901510bb4e3126b385f31956b653ef27b84449dbac43ce231",
        "fed5cd558f546235ae217891e5d8835937ed747bde1a062d568547cba29cf00c",
        "c8f0707a75d63a77e4e8962529358883c41adf2b96784753760ea56c6b06be92",
        "293617f3703968d4629ac817320bc9f9837b49a343b963bb20dfc26bae8ee728",
        "2e23e146d8bde6267d1cf012d5aa164c2ee66460465cc97a26804aee00c2342b",
        "969075e7d0732f5aac550e88e05116804c50d5224d00a7da809803624b33852c",
        "42205f19a3e7d30fe1f9d7aa35e35b6943cb03c3b750d43dd97e8cd98b8aadf9",
        "903c31751b4c21b67769ecae41f5717551f2ffc5fd3505520e9d80cd4d59add2",
        "f3ef591590da5f3ad47757361808901956ab365c4a719ed1247e88ab43c6c11d",
        "ddde7f03c081e598f7fe6d6c5422740d5e974cfa829084b50b6b768d5286261c",
        "f2faf2c90843a945e76dd2d8803e6cb74e0630f32758efdd8d4f1dcaeff40e20",
        "a732c37bfb22941d25e6f7f3b7268420acca74982548b91d1cdb703557adebc5",
        "8634efa5ab4e4e85123fcb0cbecc40c27d40e3e4b61a27b70aa1d599fb59a1c4",
        "8c834ab4d7e1f8d5a8552a3fa9f85388105325181d6c7e99003ad633fcdebcdb",
        "5532256fe623f58047a85b04b00526584f53dca79b46912f3ed9cef57bae53c1",
        "06ec70c7aca5545dc01bfb87f56be372f6ef587ee4d672438a6554249b679ab6",
        "94b0d04fa9f451d1064c5967e9428cee8b3822412f97893d3950b8f3f785bd83",
        "7577d950fb6bfc6379724b4071b6bb845b46b7adc258935f2d39b2279b4e9ed2",
        "39f411e106c22df075efa7dc1255e1a8879fb8e9d0aac26284e1deaaf12c6405",
        "ddd5d94953f445ccae1e5f487275509f18bf2dca7a4e0cac8390d4db2bab9945",
        "37b1fc0b870a84d23b08d9b1b1f2250de162888bb6e2aba26bc2ee9b9c0854a5",
        "66d1e4849ba28863187076403333f9fb1e893bf2eeec827409baf8ef3a04bb01",
        "fc73a15c97d4eaccc02aa3bbdba5184910f8f72ac0370de238987ee57de74512",
        "fca1e457caeb2204fa3c144caa1b7acae6ebf15ea57b4dd829dab8c823424e97",
        "7e6eed11dd9a150ef80aa9b65efb0a7e8a2bebb96021aacca365bf9640ad8819",
        "4bbd5802e8ae91cf9352e127a8afa32ce54e7c3c077e7a0e2d6d8897950ec0f7",
        "f24157de845980796142977c21d65d3bb4372812feb806d49f4df3295c86f06f",
        "8147fbf4667be21cdfcf4e2551f60cb1d516b2309b5640c5795871dd84daee4d",
        "2d86bb59e2901dad32b6510803df838d36e77a04b75a2c6586929bb3cd5b2607",
        "1f9baa2abaec7224d009289c1f6e332d01421a8bfe8a22095b489fee124aee95",
        "12fbe750e831c8a614b91b0d5db27c3f57895ee6ff29b9ec8e46aab32a51467f",
        "a7f717dd5668260ee4310029508c403f0b511cb9dbecd05eb39b4a6389f343e9",
        "16ea133703149f0d0946d57bca50ff7f074f6de754849aa772642324dad6be68",
        "aed72b6c4d1155d0bb0bffd041519d363a79158896d63c70becbe33649578b8b",
        "3642d652f15cf77a4e88780eb4bb52213c4debfb3f5a4bbbdf23c4378c25526f",
        "ca70e7253cdf252148fe2bb6a0a5c895d985a0ea0b510066aae0cb4e66a7e851"
      ],
      "untrusted": false
    }
  }
}

{get_transaction_data}

 

:Request a given transaction by hash

https://localmonero.co/blocks/api/get_transaction_data/{hash}

JSON Response

{
  "status": "OK",
  "transaction_data": {
    "version": 1,
    "unlock_time": 0,
    "vin": [
      {
        "key": {
          "amount": 90000000000,
          "key_offsets": [
            212077,
            31975,
            22413
          ],
          "k_image": "c0fcf3b7043419d91a098890f917aa9ff9523e8664f8b5cb7e11671ebc2362c9"
        }
      },
      {
        "key": {
          "amount": 2000000000000,
          "key_offsets": [
            169160,
            117221,
            119875
          ],
          "k_image": "511c790e2db2c028613fc6a80a2f5f32389dd7b2494bb2d48fde9170475b83a3"
        }
      }
    ],
    "vout": [
      {
        "amount": 80000000000,
        "target": {
          "key": "9bbde445a7f78bddf49b3abf47e4bd246aa4212422b6c15d328024aa76952960"
        }
      },
      {
        "amount": 1000000000000,
        "target": {
          "key": "5dc6855f3ee6d50ea82b7a60e4c4b93ccf779adf0d5c4cbb0b69224d0714aa75"
        }
      },
      {
        "amount": 1000000000000,
        "target": {
          "key": "2fb8b74c3b8ce6f4fa56b3f604bdd07f552588765b8dee7d49e68e9f8fe40431"
        }
      }
    ],
    "extra": [
      2,
      33,
      0,
      74,
      105,
      189,
      108,
      49,
      44,
      217,
      144,
      168,
      204,
      57,
      223,
      104,
      73,
      111,
      163,
      227,
      53,
      83,
      70,
      13,
      122,
      235,
      233,
      19,
      58,
      158,
      68,
      187,
      234,
      161,
      175,
      1,
      157,
      75,
      45,
      101,
      26,
      244,
      238,
      136,
      104,
      189,
      171,
      0,
      211,
      97,
      211,
      246,
      247,
      86,
      107,
      130,
      248,
      46,
      152,
      212,
      36,
      238,
      170,
      226,
      27,
      231,
      109,
      186
    ],
    "signatures": [
      "2c4af81ffed9796990a17eb8a7fdd6004f6877d30b97df817cafa6ff1959d805cdb0352a75e7d6cac4a7fb815d0ab075975a3ffdbfe364f615e0a360d25b3f0e1789d918494f7c40ba6e4e0ed25938cc287422ba4c5ca9c7d7bc52bcdbc8890d4c76065ace162266c51b6ebea11163665dc50d687b65574cea16ebd4f5dd42011638881eaa53218d2fa351f53fdbd1a129c2d179947c54e3f5f40e3bf6455f0682c8ed5c5dc0c69f762db6cffdeae85c94c076915524c846e6d721efd6526c0c",
      "5c057fbc56b1a3eb5c563eff2be57f1cad46077af2e115841005c82bf98070063e6ae375586264e126d6d89cc558364638689ed51cd64d579b05fa3b979f560f0d99859b0cceb756e453e3ad1bc241507eece5f1c8808c2816ace739c06ae1066b47256d6dd175e648f7d7e7a9972753337367ae5266d88ce0931fdb952f840a8714429f596ddd117c23ee4dfa9809ade9a28100148a31f65679c34ea1b633093f968cefbbec9cf93f1e794b8573f3f050272bde6b943c9947d44221f4e13c02"
    ]
  }
}

{is_key_image_spent}

 

:Verify the spent state of a given key image

https://localmonero.co/blocks/api/is_key_image_spent

JSON Response

{
	"spent_status":[0],
	"status":"OK"
}