> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spidra.io/llms.txt
> Use this file to discover all available pages before exploring further.

# SDKs

> Official Spidra SDKs for Node.js, Python, Go, PHP, Ruby, Java, .NET, Swift, Rust, Elixir, n8n, and MCP.

All Spidra SDKs wrap the same REST API with idiomatic helpers for your language: authentication, async job polling, error handling, and typed responses.

Pick your language and you are up and running in a few lines of code. All SDKs are open source at [github.com/spidra-io](https://github.com/spidra-io).

## Every SDK supports

* Scrape, batch scrape, and crawl
* Browser actions and forEach
* Structured output with JSON Schema
* Authenticated scraping with session cookies
* Stealth mode and proxy geo-targeting
* Async job submission and automatic polling

## Quick example

Every SDK follows the same pattern. Here is a scrape across all languages:

<CodeGroup>
  ```typescript Node.js theme={null}
  import { SpidraClient } from 'spidra'

  const spidra = new SpidraClient({ apiKey: process.env.SPIDRA_API_KEY })

  const job = await spidra.scrape.run({
    urls: [{ url: 'https://example.com/products' }],
    prompt: 'Extract all product names and prices',
    output: 'json',
  })

  console.log(job.result.content)
  ```

  ```python Python theme={null}
  import asyncio
  from spidra import AsyncSpidra, ScrapeParams, ScrapeUrl

  async def main():
      spidra = AsyncSpidra(api_key="spd_YOUR_API_KEY")

      job = await spidra.scrape(ScrapeParams(
          urls=[ScrapeUrl(url="https://example.com/products")],
          prompt="Extract all product names and prices",
          output="json",
      ))

      print(job.content)

  asyncio.run(main())
  ```

  ```go Go theme={null}
  client := spidra.New(os.Getenv("SPIDRA_API_KEY"))

  job, err := client.Scrape.Run(ctx, spidra.ScrapeParams{
      URLs:   []spidra.ScrapeURL{{URL: "https://example.com/products"}},
      Prompt: "Extract all product names and prices",
      Output: "json",
  })
  ```

  ```php PHP theme={null}
  $spidra = new SpidraClient(getenv('SPIDRA_API_KEY'));

  $job = $spidra->scrape->run([
      'urls'   => [['url' => 'https://example.com/products']],
      'prompt' => 'Extract all product names and prices',
      'output' => 'json',
  ]);
  ```

  ```ruby Ruby theme={null}
  client = Spidra.new(ENV["SPIDRA_API_KEY"])

  job = client.scrape.run(
    urls:   [{ url: "https://example.com/products" }],
    prompt: "Extract all product names and prices",
    output: "json"
  )

  puts job["result"]["content"]
  ```
</CodeGroup>

`run()` submits the job and polls until it completes. Use `submit()` and `get()` separately if you need manual control over polling.

## Official SDKs

<CardGroup cols={2}>
  <Card title="Node.js" icon="node" href="/sdks/node">
    Supports TypeScript natively. Works in Next.js, Express, Bun, and edge runtimes. LangChain and Vercel AI SDK tool support built in.
  </Card>

  <Card title="Python" icon="python" href="/sdks/python">
    Async-first with sync wrappers. Works in scripts, Django, Flask, FastAPI, and Jupyter notebooks.
  </Card>

  <Card title="Go" icon="golang" href="/sdks/go">
    Typed structs, idiomatic error handling, zero external dependencies. Standard library only.
  </Card>

  <Card title="PHP" icon="php" href="/sdks/php">
    Requires PHP 8.1+ and Guzzle 7. Typed exceptions and configurable polling timeouts.
  </Card>

  <Card title="Ruby" icon="gem" href="/sdks/ruby">
    Pure stdlib, no external dependencies. Works in Rails, Sinatra, and plain scripts.
  </Card>

  <Card title="Elixir" icon="erlang" href="/sdks/elixir">
    Idiomatic pattern matching, OTP-ready. Works with Phoenix and plain Mix projects.
  </Card>

  <Card title=".NET" icon="microsoft" href="/sdks/dotnet">
    Fully async with `Task`/`await`. Typed exceptions and JSON schema support. Requires .NET 8+.
  </Card>

  <Card title="Swift" icon="swift" href="/sdks/swift">
    Native `async/await` concurrency. Works on iOS, macOS, tvOS, watchOS, and server-side Swift.
  </Card>

  <Card title="Java" icon="java" href="/sdks/java">
    Java 17+. `CompletableFuture`-based async, builder pattern, no extra HTTP dependencies.
  </Card>

  <Card title="Rust" icon="rust" href="/sdks/rust">
    Built on `tokio` and `reqwest`. Native async/await, returns `Result<T, SpidraError>` on every call.
  </Card>
</CardGroup>

## Workflow integrations

<CardGroup cols={2}>
  <Card title="n8n" icon="diagram-project" href="/sdks/n8n">
    Native node for n8n workflows. Trigger scrapes, batch jobs, and crawls as steps in any automation.
  </Card>

  <Card title="MCP Server" icon="robot" href="/sdks/mcp">
    Give any AI assistant live web access as native tools. Works with Claude Code, Claude Desktop, Cursor, Windsurf, and VS Code.
  </Card>
</CardGroup>
