Package: graphsense-python
graphsense-pythonGraphSense API provides programmatic access to various ledgers' addresses, entities, blocks, transactions and tags for automated and highly efficient forensics tasks.This Python package is automatically generated by theOpenAPI Generatorproject:API version: 1.4.2Package version: 1.4.2Build package: org.openapitools.codegen.languages.PythonClientCodegenRequirements.Python >= 3.6Installation & Usagepip installIf the python package is hosted on a repository, you can install directly using:pipinstallgit+https://github.com/graphsense/graphsense-python.git(you may need to runpipwith root permission:sudo pip install git+https://github.com/graphsense/graphsense-python.git)Then import the package:importgraphsenseSetuptoolsInstall viaSetuptools.pythonsetup.pyinstall--user(orsudo python setup.py installto install the package for all users)Then import the package:importgraphsenseGetting StartedPlease follow theinstallation procedureand then run the following:importtimeimportgraphsensefrompprintimportpprintfromgraphsense.apiimportaddresses_apifromgraphsense.model.addressimportAddressfromgraphsense.model.address_tagsimportAddressTagsfromgraphsense.model.address_txsimportAddressTxsfromgraphsense.model.entityimportEntityfromgraphsense.model.heightimportHeightfromgraphsense.model.linksimportLinksfromgraphsense.model.neighbor_addressesimportNeighborAddresses# Defining the host is optional and defaults to https://api.ikna.io# See configuration.py for a list of all supported configuration parameters.configuration=graphsense.Configuration(host="https://api.ikna.io")# 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_keyconfiguration.api_key['api_key']='YOUR_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 clientwithgraphsense.ApiClient(configuration)asapi_client:# Create an instance of the API classapi_instance=addresses_api.AddressesApi(api_client)currency="btc"# str | The cryptocurrency code (e.g., btc)address="addressA"# str | The cryptocurrency addresstry:# Get an addressapi_response=api_instance.get_address(currency,address)pprint(api_response)exceptgraphsense.ApiExceptionase:print("Exception when calling AddressesApi->get_address:%s\n"%e)Documentation for API EndpointsAll URIs are relative tohttps://api.ikna.ioClassMethodHTTP requestDescriptionAddressesApiget_addressGET/{currency}/addresses/{address}Get an addressAddressesApiget_address_entityGET/{currency}/addresses/{address}/entityGet the entity of an addressAddressesApilist_address_linksGET/{currency}/addresses/{address}/linksGet outgoing transactions between two addressesAddressesApilist_address_neighborsGET/{currency}/addresses/{address}/neighborsGet an address's neighbors in the address graphAddressesApilist_address_txsGET/{currency}/addresses/{address}/txsGet all transactions an address has been involved inAddressesApilist_tags_by_addressGET/{currency}/addresses/{address}/tagsGet attribution tags for a given addressBlocksApiget_blockGET/{currency}/blocks/{height}Get a block by its heightBlocksApilist_block_txsGET/{currency}/blocks/{height}/txsGet block transactionsBulkApibulk_csvPOST/{currency}/bulk.csv/{operation}Get data as CSV in bulkBulkApibulk_jsonPOST/{currency}/bulk.json/{operation}Get data as JSON in bulkEntitiesApiget_entityGET/{currency}/entities/{entity}Get an entityEntitiesApilist_address_tags_by_entityGET/{currency}/entities/{entity}/tagsGet address tags for a given entityEntitiesApilist_entity_addressesGET/{currency}/entities/{entity}/addressesGet an entity's addressesEntitiesApilist_entity_linksGET/{currency}/entities/{entity}/linksGet transactions between two entitiesEntitiesApilist_entity_neighborsGET/{currency}/entities/{entity}/neighborsGet an entity's direct neighborsEntitiesApilist_entity_txsGET/{currency}/entities/{entity}/txsGet all transactions an entity has been involved inEntitiesApisearch_entity_neighborsGET/{currency}/entities/{entity}/searchSearch deeply for matching neighborsGeneralApiget_statisticsGET/statsGet statistics of supported currenciesGeneralApisearchGET/searchReturns matching addresses, transactions and labelsRatesApiget_exchange_ratesGET/{currency}/rates/{height}Returns exchange rate for a given heightTagsApiget_actorGET/tags/actors/{actor}Returns an actor given its unique id or (unique) labelTagsApiget_actor_tagsGET/tags/actors/{actor}/tagsReturns the address tags for a given actorTagsApilist_address_tagsGET/tagsReturns address tags associated with a given labelTagsApilist_conceptsGET/tags/taxonomies/{taxonomy}/conceptsReturns the supported concepts of a taxonomyTagsApilist_taxonomiesGET/tags/taxonomiesReturns the supported taxonomiesTokensApilist_supported_tokensGET/{currency}/supported_tokensReturns a list of supported token (sub)currenciesTxsApiget_spending_txsGET/{currency}/txs/{tx_hash}/spendingReturns in which other transaction's outputs the asked transaction spent. Think backwards references is the transaction graph. This endpoint is only available for utxo like currencies.TxsApiget_spent_in_txsGET/{currency}/txs/{tx_hash}/spent_inReturns in which other transactions, outputs from the asked transaction are spent. Think forward references in the transaction graph. This endpoint is only available for utxo like currencies.TxsApiget_txGET/{currency}/txs/{tx_hash}Returns details of a specific transaction identified by its hashTxsApiget_tx_ioGET/{currency}/txs/{tx_hash}/{io}Returns input/output values of a specific transaction identified by its hashTxsApilist_token_txsGET/{currency}/token_txs/{tx_hash}Returns all token transactions in a given transactionDocumentation For ModelsActorActorContextActorsAddressAddressTagAddressTagAllOfAddressTagsAddressTxAddressTxUtxoAddressTxsBlockConceptCurrencyStatsEntityEntityAddressesHeightLabeledItemRefLabeledItemRefsLinkLinkUtxoLinksNeighborAddressNeighborAddressesNeighborEntitiesNeighborEntityRateRatesSearchResultSearchResultByCurrencySearchResultLabelsSearchResultLeafSearchResultLevel1SearchResultLevel2SearchResultLevel3SearchResultLevel4SearchResultLevel5SearchResultLevel6StatsTagTaxonomyTokenConfigTokenConfigsTokenValuesTxTxAccountTxRefTxSummaryTxUtxoTxValueTxValuesTxsAccountValuesDocumentation For Authorizationapi_keyType: API keyAPI key parameter name: AuthorizationLocation: HTTP headerExamplesIn./examplesyou can find example Python scripts andJupyternotebooks demonstrating how to use the GraphSense Python API. Please Follow these setup instructions to run them:Setup a Python environment withAnaconda:conda env create -f environment.yml
conda activate graphsense-pythonCopy the config temp file and enter your Iknaio API keycp config.json.tmp config.json
vi config.jsonRun the jupyter notebooksjupyter notebookGeneration from OpenAPI specificationThis python package has been generated fromGraphsense's OpenAPI specificationhosted byIknaio Cryptoasset Analytics GmbHusing this command:make GS_REST_SERVICE_URL="https://api.ikna.io" generate-openapi-client