InstancesUbuntuCode ExecutionCopy pageExecute code in your Scrapybara instancePythonTypeScript1Start an instancefrom scrapybara import Scrapybaraclient = Scrapybara(api_key="your_api_key")instance = client.start_ubuntu()2Execute code directlyresult = instance.code.execute( code="print('Hello from Scrapybara!')", kernel_name="python3" # Optional: specify kernel)3List available kernelskernels = instance.notebook.list_kernels()4Create a notebooknotebook = instance.notebook.create( name="my_notebook", kernel_name="python3")5Add and execute cells# Add a code cellcell = instance.notebook.add_cell( notebook_id=notebook.id, type="code", content="print('Hello from Scrapybara!')")# Execute the cellresult = instance.notebook.execute_cell( notebook_id=notebook.id, cell_id=cell.id)6Execute entire notebook# Execute all cells in the notebookresults = instance.notebook.execute(notebook_id=notebook.id)7Clean up# Delete the notebook when doneinstance.notebook.delete(notebook_id=notebook.id)