Get address list entries - Webhooks

GET /address-lists/{id}/entries returns the addresses in a list, one page at a time.

GET https://public-api.getblock.io/api/v1/address-lists/{id}/entries

Parameters

Path parameter:

ParameterTypeRequiredDescription
idstringYesThe list's id (al_…).

Query parameters:

ParameterTypeRequiredDescription
limitintegerNoPage size. Default 50, at most 200.
cursorstringNoThe next_cursor of the previous page.

Request Example

bashcurl "https://public-api.getblock.io/api/v1/address-lists/al_7hK2mPq9Wx3Z/entries?limit=200" \
  -H "Authorization: Bearer $GETBLOCK_API_KEY"
javascriptconst id = 'al_7hK2mPq9Wx3Z';
const addresses = [];
let cursor;

do {
  const url = new URL(`https://public-api.getblock.io/api/v1/address-lists/${id}/entries`);
  url.searchParams.set('limit', '200');
  if (cursor) url.searchParams.set('cursor', cursor);

  const response = await fetch(url, {
    headers: { Authorization: `Bearer ${process.env.GETBLOCK_API_KEY}` }
  });
  const page = await response.json();

  addresses.push(...page.addresses);
  cursor = page.next_cursor;
} while (cursor);

console.log(addresses.length);
pythonimport os
import requests

list_id = "al_7hK2mPq9Wx3Z"
headers = {"Authorization": f"Bearer {os.environ['GETBLOCK_API_KEY']}"}
params = {"limit": 200}
addresses = []

while True:
    page = requests.get(
        f"https://public-api.getblock.io/api/v1/address-lists/{list_id}/entries",
        headers=headers,
        params=params,
    ).json()
    addresses.extend(page["addresses"])
    if "next_cursor" not in page:
        break
    params["cursor"] = page["next_cursor"]

print(len(addresses))

Response Example

json{
  "addresses": [
    "0x2f1528f344f6410d361654d22a47ef121a60c938",
    "0x742d35cc6634c0532925a3b844bc454e4438f44e"
  ],
  "next_cursor": "…"
}

Response Parameters

FieldTypeDescription
addressesarray of stringsLower-case 0x-prefixed addresses, in address order.
next_cursorstringPass it as cursor for the next page. Absent on the last page.

Use Cases

  • Export a list to compare it with your own database
  • Show the wallets in a list in your own interface

Error Handling

HTTPCodeCause
400invalid_limit, invalid_cursorlimit is not an integer, or cursor was not issued by this endpoint.
404list_not_foundNo such list among yours.