# SPICE Circuit Simulator: ngspice Netlists, Bode & Transient (`jumblemog/circuit-simulator`) Actor

Simulate SPICE netlists with ngspice: DC operating point, sweeps, AC Bode plots, transients, transfer functions and .meas. Node voltages, currents, power, gain, bandwidth, phase margin, waveform stats, charts and CSV. Common parts built in. For AI agents.

- **URL**: https://apify.com/jumblemog/circuit-simulator.md
- **Developed by:** [Jumble Mog](https://apify.com/jumblemog) (community)
- **Categories:** AI, Automation, Developer tools
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## SPICE Circuit Simulator: ngspice Netlists, Bode & Transient

**Simulate an electronic circuit from its SPICE netlist and get the numbers, the charts and the data back.** Paste a netlist, the kind in textbooks, application notes, LTspice exports or written by an AI assistant, and it runs in **ngspice**, the open-source SPICE simulator: **DC operating point, DC sweeps, AC (Bode) frequency response, transients and transfer functions**, with your **`.meas` measurements**. Every circuit comes back with **node voltages, currents and power in every source and resistor, gain, -3 dB bandwidth, unity-gain frequency and phase margin, waveform minimum, maximum, RMS and frequency**, plus **charts (PNG and SVG), CSV data of every point, Markdown and JSON**. Common diodes, LEDs, Zeners, transistors, MOSFETs, a generic op-amp and a comparator are built in, so a netlist that uses `1N4148`, `2N3904`, `2N7000` or `OPAMP_RAILS` runs without its `.model` lines. Made for electronics students and teachers, hobbyists and makers, hardware engineers checking a design idea, writers of tutorials, developers of electronics tools, and AI agents that need a circuit's real behavior instead of a guess.

![A Bode plot made by this Actor: a 1 kHz Sallen-Key active low-pass filter, gain flat at 0 dB then falling 40 dB per decade past 1 kHz, and its phase going from 0 to -180 degrees](https://api.apify.com/v2/key-value-stores/Km5b4PG3kYHdZSb1E/records/circuit-simulator-example.png?signature=1jR3SJCrG32zPCNqBs1fT)

### What it does

- **Runs a SPICE netlist in ngspice** and returns every analysis it asks for: `.op`, `.dc`, `.ac`, `.tran` and `.tf`. With none, it finds the DC operating point.
- **Reads the results for you**: node voltages, the current and power of every voltage source and resistor, total power drawn; for AC, the gain at the lowest frequency, the peak, the -3 dB corner (or band), the unity-gain frequency and phase margin; for transients, the minimum, maximum, average, RMS, peak-to-peak, final value and frequency of each signal; for `.tf`, the gain and input and output resistance.
- **Your `.meas` measurements** (rise times, delays, `WHEN`, `FIND ... AT`, `MAX`, `AVG`, `RMS`, `INTEG`) come back as named numbers, with a clear note when one never happened.
- **Charts and data**: a Bode plot (gain and phase on a log frequency axis), waveform and sweep charts as PNG and SVG, a CSV of every point the simulator computed, an evenly sampled copy of the data in the result, a Markdown report and the exact netlist that ran.
- **Built-in parts** with typical values: diodes `1N4148`, `1N914`, `1N4001`, `1N4007`, Schottky `1N5819`, `1N5822`, Zeners `1N4733` (5.1 V), `1N4742` (12 V), `1N750`, `BZX55C3V3`, LEDs `LED_RED`, `LED_YELLOW`, `LED_GREEN`, `LED_BLUE`, `LED_WHITE`, transistors `2N3904`, `2N3906`, `2N2222`, `2N2907`, `BC547B`, `BC557B`, `TIP31C`, `TIP32C`, MOSFETs `2N7000`, `BS170`, `BS250`, `IRF540N`, `IRLZ44N`, `IRF9540N`, and the subcircuits `OPAMP` (in+ in- out, ideal-like with 1 MHz gain-bandwidth and no supply limits), `OPAMP_RAILS` (in+ in- vcc vee out: 100 dB gain, 1 MHz gain-bandwidth, 1 V/µs slew rate, output to within 20 mV of the supplies and clean recovery from clipping) and `COMPARATOR` (in+ in- vcc vee out). Common spellings like `Q2N3904`, `D1N4148` and `BC547` work too.
- **Clear errors**: a missing model or subcircuit, a missing ground, a node with no DC path to ground or a transient that won't converge comes back with the reason and what to change, and is never charged.
- **Many circuits in one run**: up to 50, such as one per component value, each with its own analyses and settings.

### Who it's for

- **Students and teachers**: check homework and lab circuits, see a filter's Bode plot or a transistor's bias point, and make charts for slides and handouts.
- **Hobbyists and makers**: try an LED driver, a 555-style oscillator, a MOSFET switch or an op-amp stage before soldering.
- **Hardware engineers**: a quick SPICE run from a script or a pipeline without installing a simulator, with values swept over many runs.
- **Writers and educators**: correct numbers and clean charts for tutorials and articles.
- **Developers**: a SPICE simulation API for electronics calculators, learning apps and design tools, billed per circuit with no monthly plan.
- **AI agents and LLM apps**: language models often get circuit math wrong. An agent can write the netlist, simulate it here and answer from the real operating point, gain or waveform, with a chart to show the user.

### How to use it

1. Paste the netlist into **SPICE netlist**. The form starts with a 1 kHz active low-pass filter, so you can click **Start** right away.
2. Add analyses or measurements in their own boxes if the netlist doesn't have them, and list the **Signals to report** (such as `v(out)` or `i(V1)`) to chart only those.
3. Click **Start**. The **Overview** shows each circuit's summary and chart, **Analyses** each analysis with its numbers and file links, and **Measurements** every `.meas` result.

You can also run it through the [Apify API](https://docs.apify.com/api/v2), from Make, n8n, Zapier and other integrations, or as a tool for AI agents.

### Writing a netlist

Standard SPICE, as ngspice reads it. A short reminder:

```
RC low-pass filter
V1 in 0 DC 0 AC 1 PULSE(0 5 0 1u 1u 5m 10m)
R1 in out 1k
C1 out 0 1u
.ac dec 20 10 100k
.tran 10u 10m
.meas tran rise TRIG v(out) VAL=0.5 RISE=1 TARG v(out) VAL=4.5 RISE=1
.end
```

- The **first line is the title**. If it's already a component, a title line is added for you.
- **Node `0` (or `gnd`) is ground**, and every circuit needs it.
- **Values** take SPICE suffixes: `f p n u m k meg g t`. Note that `m` is milli and `meg` is mega, so a 1 megohm resistor is `1meg`; the result warns about resistors written like `1M`.
- **Sources**: `DC`, `AC` (the AC analysis's input), `SIN(offset amplitude frequency)`, `PULSE(v1 v2 delay rise fall width period)`, `PWL(t1 v1 t2 v2 ...)`.
- **Devices**: R, C, L, coupled inductors (K), diodes (D), BJTs (Q), MOSFETs (M), JFETs (J), switches (S, W), controlled sources (E, F, G, H), behavioral sources (B) and subcircuits (X), with your own `.model`, `.subckt`, `.param` and `.func` lines.
- **Analyses**: `.op`; `.dc V1 0 5 0.1`; `.ac dec 50 10 100k`; `.tran 10u 5m` (step, stop, and optionally start and maximum step); `.tf v(out) V1`. Up to 12 per circuit.
- **Measurements** (`.meas tran|ac|dc name ...`) follow ngspice's syntax.
- **Ignored**: `.control` blocks (the Actor writes its own), `.print`, `.plot`, `.four` and `.probe` (the results already hold everything), and `.end`. `.step`, `.noise`, `.pz` and other analyses aren't supported yet: run one circuit per value with **Several circuits** instead.

### Examples

**An active filter's corner frequency.** The form's example, a Sallen-Key low-pass filter with 11.3 kΩ, 20 nF and 10 nF around a generic op-amp, with signals `v(out)` and `v(in)`:

> AC analysis: v(out): 0 dB at 10 Hz, -3 dB at 995.7 Hz; v(in): 0 dB at 10 Hz. Transient: v(out): -969.4 mV to 969.4 mV, average 9.459 mV, RMS 681.7 mV, final -668.4 mV, 500 Hz; v(in): -0.9997 V to 0.9997 V, average 57.98 nV, RMS 707.1 mV, final -1.225 fV, 500 Hz. Measurements: gain_1k = -3.0462.

**A transistor amplifier's bias point and gain.** A common-emitter stage with a 2N3904 from the built-in library:

```
Common-emitter amplifier
VCC vcc 0 12
VIN in 0 AC 10m SIN(0 10m 1k)
C1 in b 10u
R1 vcc b 47k
R2 b 0 10k
RC vcc c 4.7k
RE e 0 1k
CE e 0 100u
Q1 c b e 2N3904
.op
.ac dec 20 10 10meg
.meas ac gain_mid FIND vdb(c) AT=10k
```

> Operating point: v(in) = 0 V, v(b) = 2.028 V, v(c) = 5.673 V, v(e) = 1.356 V, v(vcc) = 12 V; the sources deliver 18.7 mW. AC analysis: v(c): -11.49 dB at 10 Hz, peak 6.9 dB at 31.62 kHz, -3 dB (high-pass) at 82.14 Hz. Measurements: gain_mid = 6.8975.

The result also lists each resistor's voltage, current and power (RC: 6.327 V, 1.346 mA, 8.518 mW). With a 10 mV input, 6.9 dB at the collector is a voltage gain of about 220.

**An RC step response.** `V1 in 0 PULSE(0 5 0 1n 1n 5m 10m)`, `R1 in out 1k`, `C1 out 0 1u`, `.tran 10u 5m` and the rise-time measurement above:

> Transient: v(out): 0 V to 4.966 V, average 4.007 V, RMS 4.191 V, final 4.966 V; v(in): 0 V to 5 V, average 5 V, RMS 5 V, final 5 V. Measurements: rise = 0.0021972.

The 10% to 90% rise time is 2.197 ms, which is 2.197 RC, as it should be.

### How-to examples

These are examples from **Examples** above; the result lines are from their runs.

#### How to simulate a SPICE netlist online

```json
{"netlist": "Common-emitter amplifier\nVCC vcc 0 12\nVIN in 0 AC 10m SIN(0 10m 1k)\nC1 in b 10u\nR1 vcc b 47k\nR2 b 0 10k\nRC vcc c 4.7k\nRE e 0 1k\nCE e 0 100u\nQ1 c b e 2N3904\n.op\n.ac dec 20 10 10meg\n.meas ac gain_mid FIND vdb(c) AT=10k"}
```

Result: "Operating point: v(in) = 0 V, v(b) = 2.028 V, v(c) = 5.673 V, v(e) = 1.356 V, v(vcc) = 12 V; the sources deliver 18.7 mW. AC analysis: v(c): -11.49 dB at 10 Hz, peak 6.9 dB at 31.62 kHz, -3 dB (high-pass) at 82.14 Hz. Measurements: gain_mid = 6.8975." The 2N3904 comes from the built-in parts library, and each resistor's voltage, current and power is listed.

#### How to find a filter's -3 dB frequency (a Bode plot)

Add an `.ac` analysis to the filter's netlist, as in the form's Sallen-Key example. Result: "AC analysis: v(out): 0 dB at 10 Hz, -3 dB at 995.7 Hz", with a Bode plot of gain and phase.

#### How to get an RC circuit's step response and rise time

A netlist with `V1 in 0 PULSE(0 5 0 1n 1n 5m 10m)`, `R1 in out 1k`, `C1 out 0 1u`, `.tran 10u 5m` and a `.meas` for the 10% to 90% rise gives "Measurements: rise = 0.0021972": 2.197 ms, which is 2.197 RC, as it should be. The transient chart and the data points come with it.

#### How to let an AI agent check a circuit

Add this Actor to the [Apify MCP server](https://mcp.apify.com) with `https://mcp.apify.com/?tools=jumblemog/circuit-simulator`. The agent writes the netlist, runs it, and reads the operating point, the measurements and any convergence errors, instead of working out a circuit's behavior by hand.

### FAQ

**Which simulator does it use?** ngspice, the open-source SPICE simulator.

**Which analyses are there?** DC operating point, DC sweeps, AC frequency response, transients and transfer functions, plus your own `.meas` measurements.

**Does it read LTspice netlists?** Yes, LTspice exports and textbook netlists work. Parts the netlist names but doesn't define, such as a 2N3904 or a generic op-amp, come from the built-in library, with typical values. Paste the vendor's `.model` or `.subckt` for exact behavior.

**What do I get back?** A summary in words, every measurement, charts of the signals you pick, and the data as CSV.

**Does it work with Zapier, Make or n8n?** Yes. Call the Actor with its Apify app or an HTTP request and pass the summary or the chart on.

### Input

| Field | What it is |
|---|---|
| `netlist` | The SPICE netlist (required unless `circuits` is given). |
| `analyses` | Analysis lines to add, such as `.tran 10u 5m`. |
| `measurements` | `.meas` lines to add. |
| `signals` | Signals to chart and summarize: `v(out)`, `out`, `v(a,b)` (a difference) or `i(V1)`. Empty: up to 6 nodes that change, outputs first. |
| `title` | A title for the results. Empty: the netlist's title line. |
| `temperature` | The circuit's temperature in °C (default 27). |
| `dataPoints` | Points per signal in the result's data (default 500). The CSV has every point. |
| `timeLimitSeconds` | How long one circuit may simulate (default 60, up to 300). |
| `circuits` | Several circuits: a list of objects with their own `netlist` and any field above, or of netlists as text. |

### Output

One dataset item per circuit, also saved together in the run's `OUTPUT` record:

```json
{
  "title": "Active low-pass filter, Sallen-Key, 1 kHz",
  "status": "complete",
  "summary": "AC analysis: v(out): 0 dB at 10 Hz, -3 dB at 995.7 Hz; ...",
  "analyses": [
    {
      "number": 1, "type": "ac", "command": ".ac dec 50 10 100k", "points": 201,
      "signals": ["v(out)", "v(in)"],
      "results": [{"signal": "v(out)", "gainDbAtLowest": -0.0000859, "peakGainDb": 0.0000788,
                   "bandwidthHigh": 995.7, "unityGainFrequency": null, "phaseMargin": null, "text": "..."}],
      "data": {"x": "frequency", "xUnit": "Hz", "values": [10, 10.47, ...],
               "series": [{"signal": "v(out)", "gainDb": [...], "phaseDeg": [...]}]},
      "imageUrl": "https://api.apify.com/v2/key-value-stores/.../records/sim-001-...-1-ac.png",
      "svgUrl": "...", "csvUrl": "..."
    }
  ],
  "measurements": [{"name": "gain_1k", "analysis": "ac", "value": -3.046167}],
  "operatingPoint": null,
  "libraryParts": ["OPAMP_RAILS"],
  "imageUrl": "...", "markdownUrl": "...", "jsonUrl": "...", "netlistUrl": "...",
  "warnings": [], "notes": [], "ngspiceWarnings": [], "ngspiceErrors": []
}
```

A transient's results hold `min`, `max`, `average`, `rms`, `peakToPeak`, `final` and `frequency` per signal; an operating point holds `nodeVoltages`, `sources` (voltage, current, power delivered) and `resistors` (voltage, current, power). A circuit that can't be simulated has `"status": "failed"` and the reason in `error`.

### How it works

The netlist is checked and cleaned first: code fences, `µ` and `Ω` are removed, a title is added when needed, file access, `.control` blocks and shell commands are dropped or refused, ground is required, and parts used without a model are added from the built-in library. Each analysis then runs in ngspice in batch mode, with its measurements, and is written to its own binary raw file, which the Actor reads with NumPy. ngspice runs as an unprivileged user in an empty folder, with limits on CPU time, memory, file size and processes. Charts are drawn with Vega-Lite.

### Pricing

You pay per **circuit simulated**, at the price shown on this page, with every analysis, chart and file included. Circuits that can't be simulated are never charged. Simulating past the first 30 seconds of a circuit adds a small **simulation time** charge per started 10 seconds; most circuits finish in well under a second, so it rarely applies. If you set a maximum cost per run, the Actor checks before each circuit that it fits and shortens the time limit to stay within it.

### Speed

Most circuits simulate in a few hundredths of a second, and a run through the API answers in about 10 to 20 seconds, including the cloud container starting and the files being saved. Long transients of switching circuits (millions of time steps) take longer; set a maximum step or a shorter stop time to keep them quick.

### Tips and limits

- **Built-in parts are typical**, not a manufacturer's exact model. Paste the vendor's `.model` or `.subckt` for exact behavior; a part you define yourself always wins.
- **`.include` and `.lib`** only work with built-in part names; files can't be read. Paste the model text into the netlist instead.
- **Floating nodes**: a node joined only through capacitors, or an op-amp input with no DC path, makes the matrix singular. The result names such nodes; add a large resistor (such as `1G`) to ground.
- **Transient convergence**: give sources finite rise and fall times and set a maximum step (the 4th `.tran` value) for switching circuits.
- **Not supported yet**: `.step`, `.noise`, `.pz`, `.sens`, `.disto`, S-parameters, XSPICE digital and file sources, and Verilog-A models.
- **Limits**: 20,000 netlist lines, 12 analyses per circuit, 50 circuits per run, and up to 300 seconds of simulation per circuit.

### For AI agents and developers

This Actor works with the [Apify MCP server](https://mcp.apify.com), so AI agents can call it as a tool: send the netlist and read `summary`, `analyses[].results`, `measurements` and `imageUrl` from the result. A direct API call that waits for the answer:

```bash
curl -X POST "https://api.apify.com/v2/acts/jumblemog~circuit-simulator/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"netlist": "Divider\nV1 in 0 12\nR1 in out 10k\nR2 out 0 4.7k\n.op"}'
```

`run-sync` instead returns the run's `OUTPUT`: the status, how many circuits were simulated and every result as JSON.

In Python, with the `apify-client` package, sweeping a resistor over three values:

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_TOKEN")
netlist = "RC filter\nV1 in 0 AC 1\nR1 in out {r}\nC1 out 0 100n\n.ac dec 20 10 1meg"
run = client.actor("jumblemog/circuit-simulator").call(run_input={
    "circuits": [{"title": r, "netlist": netlist.format(r=r)} for r in ("1k", "4.7k", "10k")],
    "signals": ["v(out)"],
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    ac = item["analyses"][0]["results"][0]
    print(item["title"], ac["bandwidthHigh"], item["imageUrl"])
```

### Credits

- Simulation: [ngspice](https://ngspice.sourceforge.io) (BSD-3-Clause; some parts under other free licenses).
- Results: [NumPy](https://numpy.org) (BSD-3-Clause).
- Charts: [vl-convert](https://github.com/vega/vl-convert) (BSD-3-Clause) with the Inter font (SIL Open Font License), subset with [fontTools](https://github.com/fonttools/fonttools) (MIT).

# Actor input Schema

## `netlist` (type: `string`):

The circuit as a SPICE netlist: components (R1 in out 1k, C1 out 0 100n, V1 in 0 DC 5 AC 1 PULSE(0 5 0 1u 1u 1m 2m), D1 a k 1N4148, Q1 c b e 2N3904, M1 d g s s 2N7000, X1 in+ in- vcc vee out OPAMP_RAILS), .model and .subckt lines, and analyses (.op, .dc, .ac, .tran, .tf) with .meas measurements. Node 0 (or gnd) is ground. A first line that is already a component gets a title line added. Parts used without a .model come from the built-in library.

## `analyses` (type: `array`):

Analysis lines added to the netlist, such as .tran 10u 5m, .ac dec 20 10 1meg, .dc V1 0 5 0.1, .op or .tf v(out) V1. With none here or in the netlist, the DC operating point is found.

## `measurements` (type: `array`):

ngspice .meas lines added to the netlist, such as .meas tran vmax MAX v(out), .meas ac f3db WHEN vdb(out)=-3, .meas tran tr TRIG v(out) VAL=0.5 RISE=1 TARG v(out) VAL=4.5 RISE=1.

## `signals` (type: `array`):

Which voltages and currents to chart and summarize, such as v(out), out, v(out,in) (a difference) or i(V1) (the current through a voltage source). Empty: up to 6 of the circuit's nodes, outputs first.

## `title` (type: `string`):

A title for the results and files. Empty: the netlist's title line.

## `temperature` (type: `number`):

The circuit's temperature. Empty: 27 °C, SPICE's default.

## `dataPoints` (type: `integer`):

How many evenly spaced points of each signal the result's data holds (on a log axis for AC). The CSV file has every point the simulator computed.

## `timeLimitSeconds` (type: `integer`):

How long a circuit may simulate. Most finish in well under a second; long transients of switching circuits take longer. Simulating past 30 seconds is billed per started 10 seconds.

## `circuits` (type: `array`):

Simulate several circuits in one run: a list of objects with their own netlist and any field above, or of netlists as text: \[{"title": "10k", "netlist": "..."}, {"title": "22k", "netlist": "..."}]. Fields not given come from above.

## Actor input object example

```json
{
  "netlist": "Active low-pass filter, Sallen-Key, 1 kHz\nV1 in 0 DC 0 AC 1 SIN(0 1 500)\nVCC vcc 0 12\nVEE vee 0 -12\nR1 in a 11.3k\nR2 a b 11.3k\nC1 a out 20n\nC2 b 0 10n\nX1 b out vcc vee out OPAMP_RAILS\nRL out 0 10k\n.ac dec 50 10 100k\n.tran 20u 10m\n.meas ac gain_1k FIND vdb(out) AT=1k",
  "signals": [
    "v(out)",
    "v(in)"
  ],
  "dataPoints": 500,
  "timeLimitSeconds": 60
}
```

# Actor output Schema

## `results` (type: `string`):

One row per circuit: the first chart, the summary and the files.

## `analyses` (type: `string`):

Each analysis with its chart, CSV and results.

## `measurements` (type: `string`):

Every .meas result.

## `output` (type: `string`):

The OUTPUT record: every circuit in one JSON object.

## `files` (type: `string`):

Charts, CSV, Markdown, JSON and the netlists as run, in the run's key-value store.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "netlist": `Active low-pass filter, Sallen-Key, 1 kHz
V1 in 0 DC 0 AC 1 SIN(0 1 500)
VCC vcc 0 12
VEE vee 0 -12
R1 in a 11.3k
R2 a b 11.3k
C1 a out 20n
C2 b 0 10n
X1 b out vcc vee out OPAMP_RAILS
RL out 0 10k
.ac dec 50 10 100k
.tran 20u 10m
.meas ac gain_1k FIND vdb(out) AT=1k`,
    "signals": [
        "v(out)",
        "v(in)"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("jumblemog/circuit-simulator").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "netlist": """Active low-pass filter, Sallen-Key, 1 kHz
V1 in 0 DC 0 AC 1 SIN(0 1 500)
VCC vcc 0 12
VEE vee 0 -12
R1 in a 11.3k
R2 a b 11.3k
C1 a out 20n
C2 b 0 10n
X1 b out vcc vee out OPAMP_RAILS
RL out 0 10k
.ac dec 50 10 100k
.tran 20u 10m
.meas ac gain_1k FIND vdb(out) AT=1k""",
    "signals": [
        "v(out)",
        "v(in)",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("jumblemog/circuit-simulator").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "netlist": "Active low-pass filter, Sallen-Key, 1 kHz\\nV1 in 0 DC 0 AC 1 SIN(0 1 500)\\nVCC vcc 0 12\\nVEE vee 0 -12\\nR1 in a 11.3k\\nR2 a b 11.3k\\nC1 a out 20n\\nC2 b 0 10n\\nX1 b out vcc vee out OPAMP_RAILS\\nRL out 0 10k\\n.ac dec 50 10 100k\\n.tran 20u 10m\\n.meas ac gain_1k FIND vdb(out) AT=1k",
  "signals": [
    "v(out)",
    "v(in)"
  ]
}' |
apify call jumblemog/circuit-simulator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jumblemog/circuit-simulator"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/29iYXSTe3pf59hqNT/builds/omSyxtkk6IrITj9Wu/openapi.json
