### Local Example Setup and Run Source: https://github.com/tscircuit/docs/blob/main/docs/advanced/create-or-use-custom-autorouter.mdx Clone the example repository, install dependencies, and build the project to run the custom autorouter example locally. ```bash git clone https://github.com/tscircuit/example-custom-autorouter cd example-custom-autorouter bun install bun run typecheck bun run build ``` -------------------------------- ### Example Success Response Source: https://github.com/tscircuit/docs/blob/main/docs/web-apis/package-releases-get-api.md This is an example of a successful response when retrieving a package release. ```json { "ok": true, "package_release": { "package_release_id": "pkgrls_12345678-aaaa-bbbb-cccc-1234567890ab", "package_id": "pkg_12345678-aaaa-bbbb-cccc-1234567890ab", "version": "0.4.2", "is_latest": true, "is_locked": false, "created_at": "2026-01-15T12:34:56.000Z" } } ``` -------------------------------- ### Start Development Server with Bun Source: https://github.com/tscircuit/docs/blob/main/CLAUDE.md Use this command to start the local development server for tscircuit. ```bash bun run start ``` -------------------------------- ### Install the @tscircuit/api Package Source: https://github.com/tscircuit/docs/blob/main/docs/web-apis/datasheet-sdk.md Install the necessary SDK package using npm. This is the first step before using the API client. ```bash npm install @tscircuit/api ``` -------------------------------- ### Example Success Response Source: https://github.com/tscircuit/docs/blob/main/docs/web-apis/package-releases-list-api.md This is an example of a successful response when listing package releases. ```json { "ok": true, "package_releases": [ { "package_release_id": "pkgrls_11111111-aaaa-bbbb-cccc-1234567890ab", "package_id": "pkg_12345678-aaaa-bbbb-cccc-1234567890ab", "version": "0.4.1", "is_latest": false, "is_locked": true, "created_at": "2026-01-10T09:00:00.000Z" }, { "package_release_id": "pkgrls_12345678-aaaa-bbbb-cccc-1234567890ab", "package_id": "pkg_12345678-aaaa-bbbb-cccc-1234567890ab", "version": "0.4.2", "is_latest": true, "is_locked": false, "created_at": "2026-01-15T12:34:56.000Z" } ] } ``` -------------------------------- ### Install All Project Dependencies Source: https://github.com/tscircuit/docs/blob/main/docs/command-line/tsci-install.md Use this command to install all dependencies listed in your project's package.json file. This is useful for setting up a project or ensuring all packages are up-to-date. ```bash $ tsci install Found existing package.json. Installing dependencies using bun... > bun install bun install v1.3.3 (274e01c7) Checked 307 installs across 338 packages (no changes) [121.00ms] Dependencies installed successfully. ``` -------------------------------- ### Get Order Details Example Request Source: https://github.com/tscircuit/docs/blob/main/docs/web-apis/ordering-api.mdx Example cURL command to retrieve order details using the GET method and a query parameter for the order ID. Authentication is required. ```bash curl -X GET "https://api.tscircuit.com/orders/get?order_id=123e4567-e89b-12d3-a456-426614174000" \ -H "Authorization: Bearer " ``` -------------------------------- ### Example Datasheet Retrieval (RP2040) Source: https://github.com/tscircuit/docs/blob/main/docs/web-apis/datasheet-api.md This example uses curl and jq to fetch and display the first pin's information for the RP2040 datasheet. ```bash $ curl https://api.tscircuit.com/datasheets/get?chip_name=RP2040 | jq '.datasheet.pin_information[:1]' [ { "name": [ "IOVDD" ], "pin_number": "1", "description": "Power supply for digital GPIOs, nominal voltage 1.8V to 3.3V.", "capabilities": [ "Power Supply (Digital IO)" ] } ] ``` -------------------------------- ### Install Yalc Globally Source: https://github.com/tscircuit/docs/blob/main/docs/advanced/local-package-development.mdx Install yalc globally using npm or bun. ```bash npm install -g yalc # or bun install -g yalc ``` -------------------------------- ### Example Success Response Source: https://github.com/tscircuit/docs/blob/main/docs/web-apis/package-files-list-api.md This is a successful response, listing package files with their details. ```json { "ok": true, "package_files": [ { "package_file_id": "pkgfile_12345678-aaaa-bbbb-cccc-1234567890ab", "package_release_id": "pkgrls_12345678-aaaa-bbbb-cccc-1234567890ab", "file_path": "index.tsx", "content_mimetype": "text/plain", "created_at": "2026-01-15T12:34:56.000Z" }, { "package_file_id": "pkgfile_87654321-dddd-eeee-ffff-0987654321ba", "package_release_id": "pkgrls_12345678-aaaa-bbbb-cccc-1234567890ab", "file_path": "README.md", "content_mimetype": "text/markdown", "created_at": "2026-01-15T12:34:56.000Z" } ] } ``` -------------------------------- ### Create Order Example Request Source: https://github.com/tscircuit/docs/blob/main/docs/web-apis/ordering-api.mdx Example cURL command to create an order using a package release ID. Ensure your authentication token is included. ```bash curl -X POST https://api.tscircuit.com/orders/create \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"package_release_id": "123e4567-e89b-12d3-a456-426614174000"}' ``` -------------------------------- ### Install tscircuit CLI Source: https://github.com/tscircuit/docs/blob/main/docs/intro/quickstart-cli.md Install the tscircuit CLI globally using npm. ```bash npm install -g tscircuit ``` -------------------------------- ### Install a tscircuit Package Source: https://github.com/tscircuit/docs/blob/main/docs/web-apis/the-registry-api.md Install a circuit from the tscircuit registry into your npm project. ```bash bun add @tsci/seveibar.usb-c-flashlight ``` -------------------------------- ### Install Dependencies Source: https://github.com/tscircuit/docs/blob/main/docs/contributing/report-autorouter-bugs.md Install the necessary dependencies for the tscircuit-autorouter repository. ```bash bun i ``` -------------------------------- ### Manual Edits File Format Example Source: https://github.com/tscircuit/docs/blob/main/docs/guides/tscircuit-essentials/manual-edits.mdx An example of the manual edits file format, which includes pcb_placements, manual_trace_hints, and schematic_placements. ```json { pcb_placements: [ { "selector": "R1", "center": { "x": 0, "y": 6.869495369849336 }, "relative_to": "group_center", "_edit_event_id": "0.037205222437411756" } ] manual_trace_hints: [] schematic_placements: [ { selector: "R1", center: { x: 5, y: 5 }, relative_to: "group_center", }, { selector: "C1", center: { x: -5, y: -5 }, relative_to: "group_center", }, ] } ``` -------------------------------- ### Install KiCad Component Converter CLI Source: https://github.com/tscircuit/docs/blob/main/docs/guides/importing-modules-and-chips/importing-from-kicad.md Install the open-source KiCad component converter globally using npm. ```bash npm install -g kicad-component-converter ``` -------------------------------- ### Example Success Response Source: https://github.com/tscircuit/docs/blob/main/docs/web-apis/package-builds-create-api.md A successful response will return an 'ok' status and the ID of the newly created package build. ```json { "ok": true, "package_build_id": "3ab679fa-09bc-4c66-8fd8-b3a4f2d262f8" } ``` -------------------------------- ### Basic tscircuit.config.json Example Source: https://github.com/tscircuit/docs/blob/main/docs/guides/tscircuit-essentials/tscircuit-config.mdx A basic configuration file for tscircuit, specifying the main entrypoint and files to ignore. ```json { "mainEntrypoint": "lib/circuits/main-board.tsx", "ignoredFiles": [ "dist", "build", "coverage", "*.log", ".DS_Store", "temp" ] } ``` -------------------------------- ### Example Prompt for ChatGPT Source: https://github.com/tscircuit/docs/blob/main/docs/intro/quickstart-ChatGPT.mdx This is an example of a prompt you can give to ChatGPT to generate a 555 timer circuit with a square wave output in tscircuit. ```text can you create a 555 timer circuit in tscircuit with a square wave output? ``` -------------------------------- ### Basic Voltage Probe Example Source: https://github.com/tscircuit/docs/blob/main/docs/elements/voltageprobe.mdx This example demonstrates how to use the element to measure voltages at different points in a simple circuit. It includes two probes, one connected to the first resistor's input and another to its output. The circuit also includes a voltage source and two resistors, with simulation parameters defined. ```tsx export default () => ( ) ``` -------------------------------- ### Install KiCad Library from GitHub Source: https://github.com/tscircuit/docs/blob/main/docs/guides/importing-modules-and-chips/installing-kicad-libraries-from-github.md Use the `tsci add` command followed by the GitHub repository URL to install a KiCad library. This command automatically handles dependency management, type generation, and configuration. ```bash tsci add https://github.com/espressif/kicad-libraries ``` -------------------------------- ### Example Error Response: Build Not Found Source: https://github.com/tscircuit/docs/blob/main/docs/web-apis/package-builds-get-api.md This response is returned when the specified `package_build_id` does not correspond to an existing package build. ```json { "error": { "error_code": "package_build_not_found", "message": "Package build not found" } } ``` -------------------------------- ### PCB Note Text - Basic Example Source: https://github.com/tscircuit/docs/blob/main/docs/elements/pcbnotetext.mdx Demonstrates the basic usage of the element to display text on the PCB. ```javascript export default () => ( ) ``` -------------------------------- ### PCB Grid Layout Example Source: https://github.com/tscircuit/docs/blob/main/docs/guides/tscircuit-essentials/automatic-pcb-layout.mdx Arranges components in a 3-column grid with a 1mm gap. Ideal for regular arrays. ```tsx export default () => ( ) ``` -------------------------------- ### PCB Note Line Example Source: https://github.com/tscircuit/docs/blob/main/docs/elements/pcbnoteline.mdx Demonstrates a basic usage of the element to draw a red horizontal line on the PCB. ```javascript export default () => ( ) ``` -------------------------------- ### Basic Circuit for Autolayout Source: https://github.com/tscircuit/docs/blob/main/docs/guides/tscircuit-essentials/automatic-schematic-layout.mdx This example demonstrates a simple circuit with a resistor, capacitor, and chip, which will be automatically laid out by tscircuit. ```typescript export default () => ( ) ``` -------------------------------- ### Serve Built tscircuit Site with Bun Source: https://github.com/tscircuit/docs/blob/main/CLAUDE.md Use this command to serve the already built static site. ```bash bun run serve ``` -------------------------------- ### Compile tscircuit code using fetch (GET) Source: https://github.com/tscircuit/docs/blob/main/docs/web-apis/compile-api.md Example demonstrating how to use the fetch API to send tscircuit code to the compile API via a GET request. Ensure the code is compressed and Base64 encoded using `@tscircuit/create-snippet-url`. ```javascript import { getCompressedBase64SnippetString } from "@tscircuit/create-snippet-url" const circuitCode = ` export default () => ( )` const compressedCode = getCompressedBase64SnippetString(circuitCode) const response = await fetch( `https://compile.tscircuit.com/api/compile?code=${encodeURIComponent( compressedCode )}` ) const data = await response.json() // data.circuit_json contains the compiled circuit ``` -------------------------------- ### Initialize tsci Transpile Demo Project Source: https://github.com/tscircuit/docs/blob/main/docs/command-line/tsci-build.md Commands to set up a new directory and initialize a tsci project for demonstrating the transpile build flow. ```bash mkdir tsci-transpile-demo cd tsci-transpile-demo tsci init ``` -------------------------------- ### Get Order Quote Response Source: https://github.com/tscircuit/docs/blob/main/docs/web-apis/ordering-api.mdx Example response detailing a completed order quote, including component costs, PCB cost, shipping options, and total cost. ```json { "order_quote": { "order_quote_id": "123e4567-e89b-12d3-a456-426614174000", "vendor_name": "jlcpcb", "is_completed": true, "quoted_components": [ { "manufacturer_part_number": "CC0603KRX7R9BB101", "quantity": 10, "total_cost": 0.5, "available": true } ], "bare_pcb_cost": 20.0, "shipping_options": [ { "carrier": "dhl", "service": "express", "cost": 9.5 } ], "total_cost_without_shipping": 25.0 } } ``` -------------------------------- ### Install tscircuit CLI Source: https://github.com/tscircuit/docs/blob/main/docs/tutorials/build-a-custom-keyboard-with-tscircuit.mdx Install the tscircuit command-line interface (CLI) globally using npm or bun. This command installs the 'tsci' command for creating, developing, and exporting tscircuit projects. ```bash npm install -g tscircuit # or bun install -g tscircuit ``` -------------------------------- ### Analog SPICE Simulation Example Source: https://github.com/tscircuit/docs/blob/main/docs/command-line/tsci-simulate.md Demonstrates running an analog SPICE simulation on a circuit file and displays sample output including simulation notes and results. ```bash $ tsci simulate analog my-circuit.circuit.tsx ngspice 1 -> ngspice 1 -> Note: No compatibility mode selected! Circuit: * circuit json to spice netlist ngspice 2 -> Doing analysis at TEMP = 27.000000 and TNOM = 27.000000 Using SPARSE 1.3 as Direct Linear Solver Operating point simulation skipped by 'uic', now using transient initial conditions. No. of Data Rows : 1011 ngspice 3 -> binary raw file "out.raw" Index time v(n1) v(n2) v(vp_in1) i(vsimulation_voltage_source_0) 0 1.000000e-6 6.283184e-4 6.283184e-4 1.256637e-3 -1.742483e-15 1 2.000000e-6 1.256637e-3 1.256637e-3 2.513274e-3 -3.485349e-15 2 4.000000e-6 2.513273e-3 2.513273e-3 5.026547e-3 -6.972993e-15 3 8.000000e-6 5.026544e-3 5.026544e-3 1.005309e-2 -1.396437e-14 4 1.600000e-5 1.005307e-2 1.005307e-2 2.010614e-2 -2.807686e-14 5 3.200000e-5 2.010598e-2 2.010598e-2 4.021195e-2 -5.737260e-14 ``` -------------------------------- ### Initialize a New TSCircuit Project Source: https://github.com/tscircuit/docs/blob/main/docs/command-line/tsci-init.md Bootstrap a new TSCircuit project in the current directory. Use `-y` to accept defaults and skip prompts, or `--no-install` to skip dependency installation. ```bash mkdir my-circuit cd my-circuit # Initialize with prompts tsci init # or skip prompts tsci init -y # skip dependency installation tsci init -y --no-install ``` -------------------------------- ### Install Specific Package from GitHub URL Source: https://github.com/tscircuit/docs/blob/main/docs/command-line/tsci-install.md Install a specific package directly from a GitHub repository URL. This is useful for installing libraries or dependencies not available on npm or when using a specific version from a repository. ```bash tsci install https://github.com/espressif/kicad-libraries ``` -------------------------------- ### Initialize a new tscircuit Project Source: https://github.com/tscircuit/docs/blob/main/docs/intro/quickstart-cli.md Create a new tscircuit project directory with essential files. ```bash tsci init ``` -------------------------------- ### Example Error Response Source: https://github.com/tscircuit/docs/blob/main/docs/web-apis/package-releases-list-api.md This is an example of an error response, for instance, if required parameters are missing. ```json { "ok": false, "error": { "message": "package_id or package_name is required", "error_code": "validation_error" } } ``` -------------------------------- ### Basic Analog Simulation Setup Source: https://github.com/tscircuit/docs/blob/main/docs/elements/analogsimulation.mdx This snippet demonstrates how to set up a basic analog simulation for a tscircuit board. It includes a voltage source, a resistor, voltage probes, and the analog simulation configuration. ```typescript export default () => ( ) ``` -------------------------------- ### Example SimpleRouteJson Object Source: https://github.com/tscircuit/docs/blob/main/docs/web-apis/autorouting-api.mdx An example JSON object conforming to the SimpleRouteJson interface, illustrating obstacles and connections for autorouting. ```json { "layerCount": 2, "minTraceWidth": 0.2, "obstacles": [ { "type": "rect", "layers": ["top"], "center": { "x": 30, "y": 25 }, "width": 10, "height": 8, "connectedTo": ["power"] }, { "type": "rect", "layers": ["bottom"], "center": { "x": 70, "y": 25 }, "width": 12, "height": 6, "connectedTo": ["ground"] } ], "connections": [ { "name": "power_net", "pointsToConnect": [ { "x": 10, "y": 10, "layer": "top" }, { "x": 90, "y": 40, "layer": "bottom" } ] }, { "name": "ground_net", "pointsToConnect": [ { "x": 20, "y": 20, "layer": "top" }, { "x": 80, "y": 30, "layer": "top" } ] } ], "bounds": { "minX": 0, "maxX": 100, "minY": 0, "maxY": 50 } } ``` -------------------------------- ### Build tscircuit Site with Bun Source: https://github.com/tscircuit/docs/blob/main/CLAUDE.md Command to build the static site for tscircuit. ```bash bun run build ``` -------------------------------- ### Run the tscircuit Development Server Source: https://github.com/tscircuit/docs/blob/main/docs/intro/quickstart-cli.md Start a local development server that automatically rebuilds your circuit on changes. Access the preview at http://localhost:3020. ```bash tsci dev ``` -------------------------------- ### Basic tsci dev Usage Source: https://github.com/tscircuit/docs/blob/main/docs/command-line/tsci-dev.md Run a local preview server for your tscircuit project. Specify an optional entrypoint file. ```bash tsci dev [file] [options] ``` -------------------------------- ### Install tscircuit CLI Globally Source: https://github.com/tscircuit/docs/blob/main/docs/intro/installation.md Installs the tscircuit command-line tool globally on your system. This makes the 'tsci' command available from any directory. ```bash npm install -g tscircuit ``` ```bash bun install --global tscircuit ``` -------------------------------- ### Output Directory Structure Example Source: https://github.com/tscircuit/docs/blob/main/docs/command-line/tsci-build.md Illustrates the file and directory structure generated by tsci build with various options enabled. This helps in understanding where different output artifacts will be placed. ```text dist/ ├── my-circuit/ │ ├── circuit.json # Always generated for that build output │ ├── pcb.svg # With --preview-images/--all-images, --svgs, --pcb-svgs, etc. │ ├── schematic.svg # With --preview-images/--all-images, --svgs, --schematic-svgs, etc │ ├── 3d.png # With --preview-images/--all-images, --pngs, or --3d │ ├── 3d.glb # With --glbs │ └── kicad/ │ ├── my-circuit.kicad_sch # With --kicad-project │ ├── my-circuit.kicad_pcb # With --kicad-project │ └── my-circuit.kicad_pro # With --kicad-project ├── my-circuit.gltf # With --preview-gltf (preview entrypoint only) ├── kicad-library/ # With --kicad-library ├── pcm/ # With --kicad-pcm ├── index.html # With --site ├── standalone.min.js # With --site (unless --use-cdn-javascript) ├── index.js # With --transpile ├── index.cjs # With --transpile └── index.d.ts # With --transpile ``` -------------------------------- ### Install @tscircuit/create-snippet-url Source: https://github.com/tscircuit/docs/blob/main/docs/web-apis/image-generation-api.mdx Install the official package for generating tscircuit image URLs. This package handles URL encoding, compression, and proper formatting. ```bash npm install @tscircuit/create-snippet-url # or bun add @tscircuit/create-snippet-url ``` -------------------------------- ### Serve Static Site Locally Source: https://github.com/tscircuit/docs/blob/main/docs/guides/running-tscircuit/building-static-sites-with-tsci.mdx Inspect the generated static site locally using a static file server. ```bash npx serve dist ``` -------------------------------- ### Create a Via Source: https://github.com/tscircuit/docs/blob/main/docs/elements/via.mdx Demonstrates how to create a basic via connecting the top and bottom layers of a PCB with specified diameters and position. ```jsx export default () => ( ) ``` -------------------------------- ### Build Static Site with tsci Source: https://github.com/tscircuit/docs/blob/main/docs/guides/running-tscircuit/building-static-sites-with-tsci.mdx Generates a static site including index.html and circuit assets in the dist folder. ```bash npx tsci build --site ``` -------------------------------- ### Install tscircuit as a Project Dev Dependency Source: https://github.com/tscircuit/docs/blob/main/docs/intro/installation.md Installs tscircuit as a development dependency for the current project. This is useful for managing tscircuit versions on a per-project basis. ```bash npm add -D tscircuit ``` ```bash bun add -D tscircuit ``` -------------------------------- ### Type-Safe Chip Pin Access Examples Source: https://github.com/tscircuit/docs/blob/main/docs/guides/tscircuit-essentials/using-sel-references.mdx Provides examples of type-safe chip pin referencing using `sel` and highlights how TypeScript catches non-existent pins. ```tsx import { sel } from "tscircuit" import { MyChip } from "./my-chip" sel.U1(MyChip).VCC // ".U1 > .VCC" sel.U1(MyChip).GND // ".U1 > .GND" // TypeScript will error on non-existent pins! // sel.U1(MyChip).DOES_NOT_EXIST -> ERROR! ``` -------------------------------- ### Display tscircuit CLI Help Source: https://github.com/tscircuit/docs/blob/main/docs/intro/installation.md Tests the installation by displaying the help message for the tscircuit CLI. This confirms that the 'tsci' command is accessible and functional. ```bash tsci --help ``` -------------------------------- ### AI Generated Circuit Code Example Source: https://github.com/tscircuit/docs/blob/main/docs/guides/circuit-generation/generating-circuit-boards-with-ai.mdx An example of tscircuit code that an AI might generate for an Arduino Shield, including a chip component with pin labels. ```tsx import { ArduinoShield } from "@tscircuit/common"; export default () => ( {/* ... rest of circuit ... */} ); ``` -------------------------------- ### Download by Package Name and Version Source: https://github.com/tscircuit/docs/blob/main/docs/web-apis/package-files-download-api.md Use these query parameters to download a file by specifying the package owner, name, version, and the file's path within the package. ```http GET /package_files/download?package_name_with_version=/@&file_path= ``` -------------------------------- ### Install tscircuit Skill Source: https://github.com/tscircuit/docs/blob/main/docs/advanced/ai-context.mdx Install the tscircuit skill for your AI assistant to design boards. This command adds the necessary components for the AI to understand and use tscircuit. ```bash npx skills add tscircuit/skill ``` -------------------------------- ### Compile Endpoint (GET) Source: https://github.com/tscircuit/docs/blob/main/docs/web-apis/compile-api.md Compiles tscircuit code via a GET request. The source code must be provided as a compressed Base64 string in the 'code' query parameter. ```APIDOC ## GET /compile ### Description Compile tscircuit code via GET request with compressed code parameter. ### Method GET ### Endpoint /compile?code={compressed_code} ### Parameters #### Query Parameters - **code** (string) - Required - Compressed Base64 string of tscircuit JSX/TSX code (generated using `@tscircuit/create-snippet-url`). Alternatively, you can use `fs_map` parameter with a compressed JSON object mapping filenames to code. ### Request Example ```javascript import { getCompressedBase64SnippetString } from "@tscircuit/create-snippet-url" const circuitCode = ` export default () => ( )` const compressedCode = getCompressedBase64SnippetString(circuitCode) const response = await fetch( `https://compile.tscircuit.com/api/compile?code=${encodeURIComponent( compressedCode )}` ) const data = await response.json() // data.circuit_json contains the compiled circuit ``` ### Response #### Success Response (200) - **circuit_json** (object) - The compiled circuit in JSON format. - **logs** (array) - An array detailing events during the compile process. The first entry records the version of `tscircuit` used for the build. ``` -------------------------------- ### Build and Publish Local Package with Yalc Source: https://github.com/tscircuit/docs/blob/main/docs/advanced/local-package-development.mdx Build your local package and publish it to the yalc local store. Ensure the package is built before publishing. ```bash cd path/to/your/local/package # Build the package first bun run build # or npm run build # Then publish to yalc yalc publish ``` -------------------------------- ### Add a tscircuit package Source: https://github.com/tscircuit/docs/blob/main/docs/command-line/tsci-add.mdx Use `tsci add` to install a package from the tscircuit registry. The command defaults to the tscircuit registry and installs the package with the specified author and package name. ```bash > tsci add seveibar/PICO_W # Added @tsci/seveibar.PICO_W@0.0.1 ``` -------------------------------- ### Get the Latest Package Release Source: https://github.com/tscircuit/docs/blob/main/docs/web-apis/finding-package-releases.md Retrieve the details of the latest release for a specific package using the `/package_releases/get` endpoint with `is_latest: true`. This is a convenient way to get the `package_release_id` for the most recent version. ```http POST /package_releases/get { "package_name": "/", "is_latest": true } ``` ```json { "ok": true, "package_release": { "package_release_id": "pkgrls_12345678-aaaa-bbbb-cccc-1234567890ab", "package_id": "pkg_12345678-aaaa-bbbb-cccc-1234567890ab", "version": "0.4.2", "is_latest": true, "created_at": "2026-01-15T12:34:56.000Z" } } ``` -------------------------------- ### Example Success Response for Package Build Source: https://github.com/tscircuit/docs/blob/main/docs/web-apis/package-builds-get-api.md This response indicates a successful retrieval of package build information, including its status and any associated errors or log URLs. ```json { "ok": true, "package_build": { "package_build_id": "77259a87-8a4f-4365-888c-45d5d70567a8", "package_release_id": "96cc184a-fb65-4458-8eca-488c38977a8d", "created_at": "2025-08-15T16:13:14.625Z", "build_in_progress": false, "transpilation_in_progress": false, "circuit_json_build_in_progress": false, "image_generation_in_progress": false, "transpilation_error": null, "circuit_json_build_error": null, "image_generation_error": null, "user_code_job_error": null, "user_code_job_log_stream_url": null, "user_code_job_completed_logs": null } } ``` -------------------------------- ### Example Success Response (File Content) Source: https://github.com/tscircuit/docs/blob/main/docs/web-apis/package-files-download-api.md On a successful request, the API returns the raw content of the requested file. This example shows a React component that might be generated or used in conjunction with the API. ```tsx import { exampleFootprint } from "@tsci/example-lib" export const ExamplePackage = () => { return } ``` -------------------------------- ### Job API: Get Autorouting Job Status Source: https://github.com/tscircuit/docs/blob/main/docs/web-apis/autorouting-api.mdx Query the status of an ongoing autorouting job using its ID. The 'get' endpoint provides information on whether the job is still running or has finished. ```http GET /autorouting/jobs/get?autorouting_job_id=1234567890 RESPONSE: { "autorouting_job": { "is_running": false, "is_finished": true, // ... } } ``` -------------------------------- ### Search and Interactively Import Component Source: https://github.com/tscircuit/docs/blob/main/docs/command-line/tsci-import.md Searches across both JLCPCB and the tscircuit registry for a component and prompts for interactive selection. It then installs the selected component into the project. ```bash tsci import "ESP32-S3" ``` -------------------------------- ### Example Datasheet Response Structure Source: https://github.com/tscircuit/docs/blob/main/docs/web-apis/datasheet-sdk.md A successful 'datasheets/get' call returns a JSON object containing all datasheet fields. This example shows an abbreviated structure for the RP2040, including its ID, chip name, PDF URLs, and pin information. ```json { "datasheet": { "datasheet_id": "2a51fc64-5154-4513-ad7c-29429bdc973e", "chip_name": "RP2040", "datasheet_pdf_urls": [ "https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf" ], "pin_information": [ { "name": ["IOVDD"], "pin_number": "1", "description": "Power supply for digital GPIOs, nominal voltage 1.8V to 3.3V.", "capabilities": ["Power Supply (Digital IO)"] } ] } } ```