Get contract map entry

Retrieves a specific entry from a contract data map.

POST

/v2/map_entry/{contract_address}/{contract_name}/{map_name}

Attempt to fetch data from a contract data map. The contract is identified with a Stacks address contract_address and contract name contract_address in the URL path. The map is identified with [Map Name].

The key to look up in the map is supplied via the POST body. This should be supplied as the hex string serialization of the key (which should be a Clarity value). Note: this is a JSON string atom.

In the response, data is the hex serialization of the map response. Note: map responses are Clarity option types. For non-existent values, this is a serialized none, and for all other responses, it is a serialized (some ...) object.

Request body

Hex string serialization of the lookup key (which should be a Clarity value)

body
Required
string

Path parameters

contract_address
Required
string

Stacks address

Example: "SPSCWDV3RKV5ZRN1FQD84YE1NQFEDJ9R1F4DYQ11"

contract_name
Required
string

Contract name

Example: "newyorkcitycoin-core-v2"

map_name
Required
string

Map name

Example: "approved-contracts"

Query parameters

proofinteger

Returns object without the proof field when set to 0

tipstring

The Stacks chain tip to query from

Status codeDescription
200Success
400Failed loading data map
Terminal
curl -X POST "https://api.mainnet.hiro.so/v2/map_entry/SPSCWDV3RKV5ZRN1FQD84YE1NQFEDJ9R1F4DYQ11/newyorkcitycoin-core-v2/approved-contracts" \
  -d 'string'

Response of get data map entry request

Example response
{
  "data": "string",
  "proof": "string"
}