Getting code of a specific node

GET /code/node

Get the code of a specific node in the parsed codebase. These nodes are typically your endpoints or their child functions that were listed as part of flow graph.

Headers

Query Params

Response

{
    "code": "@api.get(\"/search\")\ndef search(args):\n    q = args.get(\"q\", None)\n\n    if q is None:\n        return { \"error\": \"q parameter required\" }\n    else:\n        results = []\n        for item in example_data[\"items\"]:\n            if item[\"name\"].count(q) > 0:\n                results.append(item)\n        return { \"count\": len(results), \"items\": results }",
    "file": "local-file-path/filename.py",
    "project_id": 4,
    "response": "",
    "start": 55,
    "end": 66,
    "id": "/server.py:search",
    "type": "function",
    "parameters": "[{\"identifier\": \"args\", \"type\": null}]"
}

Last updated