# Client libraries for Python, JavaScript and Rust | Spider

Official Spider API client libraries for Python, JavaScript, and Rust, with install steps and a first request for each.

Canonical: https://spider.cloud/docs/libraries/

## Spider client libraries

Official SDKs for Python, JavaScript, Rust, and Go. Each wraps the REST API with typed methods for crawling, scraping, and search. All you need is an [API key](https://spider.cloud/api-keys/).

01

## Python

[GitHub ↗](https://github.com/spider-rs/spider-clients/tree/main/python)

```
pip install spider_client
```

```
from spider import Spider

app = Spider()
params = {"limit": 5}
crawl_result = app.crawl_url("https://example.com", params=params)
```

02

## JavaScript / TypeScript

[GitHub ↗](https://github.com/spider-rs/spider-clients/tree/main/javascript)

```
npm install @spider-cloud/spider-client
```

```
import { Spider } from "@spider-cloud/spider-client";

const app = new Spider();
const params = { limit: 5 };
const result = await app.crawlUrl("https://example.com", params);
```

03

## Rust

[GitHub ↗](https://github.com/spider-rs/spider-clients/tree/main/rust)

```
cargo add spider-client
```

```
let spider = spider_client::Spider::new(None).expect("API required");
let crawler_params = RequestParams { limit: Some(5), ..Default::default() };

let crawl_result = spider
    .crawl_url("https://example.com", Some(crawler_params), false, "application/json", None)
    .await
    .expect("Failed to crawl the URL");
```

04

## Go

[GitHub ↗](https://github.com/spider-rs/spider-clients/tree/main/go)

```
go get github.com/spider-rs/spider-clients/go
```

```
package main

import (
    "context"
    "fmt"
    spider "github.com/spider-rs/spider-clients/go"
)

func main() {
    client := spider.New("")
    pages, _ := client.CrawlURL(
        context.Background(),
        "https://example.com",
        &spider.SpiderParams{Limit: 5},
    )
    for _, page := range pages {
        fmt.Printf("%s: %d chars\n", page.URL, len(page.Content))
    }
}
```

05

## CLI

Install with [cargo](https://doc.rust-lang.org/cargo/commands/cargo-install.html), authenticate once, then run any subcommand.

```
cargo install spider-cloud-cli
```

```
spider-cloud-cli auth --api_key YOUR_API_KEY
```

```
spider-cloud-cli crawl --url https://example.com --limit 5
```

Run `spider-cloud-cli --help` in the terminal to see every subcommand.
