Skip to main content

GraphSense API

Project description

graphsense-python

GraphSense API provides programmatic access to blockchain analytics data across multiple ledgers. Use it to explore addresses, clusters, blocks, transactions, tags, token activity, and exchange-rate context, and to integrate investigation workflows into your own applications and automation.

Versioning and deprecation policy

The API follows semantic versioning. Minor releases are additive and backwards-compatible; breaking changes only happen in major releases, which are rare and announced in advance.

Deprecated endpoints and fields remain fully functional for at least six months after they are marked deprecated. During that window they are highlighted with a strikethrough in the docs and in generated clients, and responses from deprecated endpoints carry a Deprecation HTTP header that client tooling can detect. Replacement endpoints and fields are always introduced before the deprecated surface is removed.

See the full versioning and deprecation policy for details.

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 2.13.2
  • Package version: 2.13.2
  • Generator version: 7.19.0
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit https://www.iknaio.com/

Requirements.

Python 3.9+

Installation & Usage

This project uses uv for environment and dependency management.

Add to a uv project

uv add graphsense-python
# or, to include the optional `[cli]` extra (installs the `graphsense` CLI):
uv add 'graphsense-python[cli]'

Install from git

uv add 'git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git'

One-off script usage

uv run --with graphsense-python python my_script.py

Then import the package:

import graphsense

Tests

Execute uv run pytest to run the tests.

Getting Started

Please follow the installation procedure and then run the following:

import graphsense
from graphsense.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.iknaio.com
# See configuration.py for a list of all supported configuration parameters.
configuration = graphsense.Configuration(
    host = "https://api.iknaio.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: api_key
configuration.api_key['api_key'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api_key'] = 'Bearer'


# Enter a context with an instance of the API client
with graphsense.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = graphsense.AddressesApi(api_client)
    currency = 'btc' # str | The cryptocurrency code (e.g., btc)
    address = '1Archive1n2C579dMsAu3iC6tWzuQJz8dN' # str | The cryptocurrency address
    include_actors = True # bool | Whether to include actor information (optional) (default to True)

    try:
        # Get an address
        api_response = api_instance.get_address(currency, address, include_actors=include_actors)
        print("The response of AddressesApi->get_address:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling AddressesApi->get_address: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://api.iknaio.com

Class Method HTTP request Description
AddressesApi get_address GET /{currency}/addresses/{address} Get an address
AddressesApi get_address_cluster GET /{currency}/addresses/{address}/cluster Get the cluster for an address
AddressesApi get_address_entity GET /{currency}/addresses/{address}/entity Get the entity for an address
AddressesApi get_tag_summary_by_address GET /{currency}/addresses/{address}/tag_summary Get address attribution tag summary
AddressesApi list_address_links GET /{currency}/addresses/{address}/links List transactions between two addresses
AddressesApi list_address_neighbors GET /{currency}/addresses/{address}/neighbors List neighboring addresses
AddressesApi list_address_txs GET /{currency}/addresses/{address}/txs List transactions involving an address
AddressesApi list_related_addresses GET /{currency}/addresses/{address}/related_addresses List related addresses
AddressesApi list_tags_by_address GET /{currency}/addresses/{address}/tags List attribution tags for an address
BlocksApi get_block GET /{currency}/blocks/{height} Get block details by height
BlocksApi get_block_by_date GET /{currency}/block_by_date/{date} Get block at or before a date
BlocksApi list_block_txs GET /{currency}/blocks/{height}/txs List transactions in a block
BulkApi bulk_csv POST /{currency}/bulk.csv/{operation} Stream bulk operation results as CSV
BulkApi bulk_json POST /{currency}/bulk.json/{operation} Stream bulk operation results as JSON
ClustersApi get_cluster GET /{currency}/clusters/{cluster} Get cluster details
ClustersApi list_address_tags_by_cluster GET /{currency}/clusters/{cluster}/tags List cluster address tags
ClustersApi list_cluster_addresses GET /{currency}/clusters/{cluster}/addresses List cluster addresses
ClustersApi list_cluster_links GET /{currency}/clusters/{cluster}/links List transactions between clusters
ClustersApi list_cluster_neighbors GET /{currency}/clusters/{cluster}/neighbors List neighboring clusters
ClustersApi list_cluster_txs GET /{currency}/clusters/{cluster}/txs List cluster transactions
ClustersApi search_cluster_neighbors GET /{currency}/clusters/{cluster}/search Search cluster neighborhood
EntitiesApi get_entity GET /{currency}/entities/{entity} Get entity details
EntitiesApi list_address_tags_by_entity GET /{currency}/entities/{entity}/tags List entity address tags
EntitiesApi list_entity_addresses GET /{currency}/entities/{entity}/addresses List entity addresses
EntitiesApi list_entity_links GET /{currency}/entities/{entity}/links List transactions between entities
EntitiesApi list_entity_neighbors GET /{currency}/entities/{entity}/neighbors List neighboring entities
EntitiesApi list_entity_txs GET /{currency}/entities/{entity}/txs List entity transactions
EntitiesApi search_entity_neighbors GET /{currency}/entities/{entity}/search Search entity neighborhood
GeneralApi get_statistics GET /stats Get platform statistics for supported currencies
GeneralApi search GET /search Search addresses, transactions, actors, and labels
RatesApi get_exchange_rates GET /{currency}/rates/{height} Get fiat exchange rates at a block height
TagsApi get_actor GET /tags/actors/{actor} Get actor details by ID
TagsApi get_actor_tags GET /tags/actors/{actor}/tags List tags associated with an actor
TagsApi list_address_tags GET /tags List address tags by label
TagsApi list_concepts GET /tags/taxonomies/{taxonomy}/concepts List concepts for a taxonomy
TagsApi list_taxonomies GET /tags/taxonomies List all taxonomies
TagsApi report_tag POST /tags/report-tag Submit a user-reported tag
TokensApi list_supported_tokens GET /{currency}/supported_tokens List supported tokens for a currency
TxsApi get_spending_txs GET /{currency}/txs/{tx_hash}/spending List source transactions
TxsApi get_spent_in_txs GET /{currency}/txs/{tx_hash}/spent_in List spending transactions
TxsApi get_tx GET /{currency}/txs/{tx_hash} Get transaction details by hash
TxsApi get_tx_conversions GET /{currency}/txs/{tx_hash}/conversions List DeFi conversions in a transaction
TxsApi get_tx_io GET /{currency}/txs/{tx_hash}/{io} List transaction inputs or outputs
TxsApi list_token_txs GET /{currency}/token_txs/{tx_hash} List token transfers in a transaction
TxsApi list_tx_flows GET /{currency}/txs/{tx_hash}/flows List transaction asset flows

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

api_key

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Author

contact@iknaio.com

Using the high-level wrapper or CLI

  • PythonREADME_EXT.md documents graphsense.ext.GraphSense, a single facade that removes boilerplate and bundles commonly-paired calls (ships with the base install).
  • ShellREADME_CLI.md documents the graphsense CLI (installed via uv add 'graphsense-python[cli]'): pipe-friendly, JSON/CSV I/O, auto-bulk.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

graphsense_python-2.13.2.tar.gz (138.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

graphsense_python-2.13.2-py3-none-any.whl (284.2 kB view details)

Uploaded Python 3

File details

Details for the file graphsense_python-2.13.2.tar.gz.

File metadata

  • Download URL: graphsense_python-2.13.2.tar.gz
  • Upload date:
  • Size: 138.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for graphsense_python-2.13.2.tar.gz
Algorithm Hash digest
SHA256 c6ca3d51f5b469b6630045ad83f43c0462fe52f7046a4cef988b1e19d2e454bd
MD5 046bae1d7a9e927e21ebedc442617460
BLAKE2b-256 d737a737f7ad64e60c50f387cd7c67a563655a0163ce1c6fcd4b1aac98635345

See more details on using hashes here.

File details

Details for the file graphsense_python-2.13.2-py3-none-any.whl.

File metadata

  • Download URL: graphsense_python-2.13.2-py3-none-any.whl
  • Upload date:
  • Size: 284.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for graphsense_python-2.13.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1d67e3cc7ddf57ed249b2b77fce63d3368d7be86eaf009fd7181d077876bb4af
MD5 bc1837234093bbf1bc9d8730e5035d92
BLAKE2b-256 8f71d2846b4ae6704729774f6c6d619fab921dd4cf963cba6abcb25122ea744a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page