{"id":24816,"library":"vt-graph-api","title":"VirusTotal Graph API Python Client","description":"The official Python client library for VirusTotal Graph API (version 2.2.0). Enables querying VirusTotal's graph database using Cypher-like queries. Release cadence is ad-hoc.","status":"active","version":"2.2.0","language":"python","source_language":"en","source_url":"https://github.com/virustotal/vt-graph-api","tags":["virus-total","graph-api","cypher","threat-intelligence"],"install":[{"cmd":"pip install vt-graph-api","lang":"bash","label":"PyPI install"}],"dependencies":[{"reason":"HTTP client for API calls","package":"requests","optional":false},{"reason":"Python 2/3 compatibility (legacy)","package":"six","optional":false}],"imports":[{"note":"Direct import of module gives no class; must import class by name","wrong":"import vt_graph_api","symbol":"VTGraphAPI","correct":"from vt_graph_api import VTGraphAPI"}],"quickstart":{"code":"from vt_graph_api import VTGraphAPI\nimport os\n\napi_key = os.environ.get('VT_API_KEY', '')\nclient = VTGraphAPI(api_key)\ntry:\n    result = client.query(\"MATCH (node:file {sha256: '275a021bbfb6489e54d471899f7db9d1663fc695ec2fe2a2c4538aabf651fd0f'}) RETURN node\")\n    print(result)\nexcept Exception as e:\n    print(f\"Error: {e}\")","lang":"python","description":"Initialize client with API key and run a Cypher query."},"warnings":[{"fix":"Upgrade to Python 3.6+ and use vt-graph-api >=2.0.0.","message":"Python 2 support was dropped in v2.0.0. Use Python 3.6+.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Always wrap in try/except and validate your Cypher syntax beforehand.","message":"The 'query' method returns raw dict results. It does not validate queries before sending.","severity":"gotcha","affected_versions":"all"},{"fix":"Replace 'get' calls with 'query'.","message":"The method 'get' is deprecated since v2.0.0 in favor of 'query'.","severity":"deprecated","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Ensure you have installed 'vt-graph-api' via pip (not 'vt_graph_api') and are importing from 'vt_graph_api'.","cause":"The package is installed but Python cannot find the module. Possibly installed in a different environment or using wrong import path.","error":"ImportError: No module named vt_graph_api"},{"fix":"Upgrade to version >=2.0.0: pip install --upgrade vt-graph-api","cause":"Using an older version (<2.0.0) where 'query' method did not exist.","error":"AttributeError: 'VTGraphAPI' object has no attribute 'query'"},{"fix":"Set the VT_API_KEY environment variable or pass a valid API key to the constructor.","cause":"Invalid or missing API key.","error":"HTTPError: 401 Client Error: Unauthorized"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}