# SDK и библиотеки

> URL: https://foura.ai/ru/docs/getting-started/sdks-and-libraries
> Updated: 2026-07-01
> Index: https://foura.ai/llms.txt

FourA является REST API: вы можете использовать его с любым языком, поддерживающим HTTP. Ниже приведены примеры для быстрого старта на самых популярных языках.

## Python

Использование библиотеки `requests`:

```python
import requests

response = requests.post(
    "https://eu.api.foura.ai/api/single/",
    headers={
        "X-API-Key": "YOUR_API_KEY",
        "Content-Type": "application/json"
    },
    json={
        "method": "GET",
        "url": "https://example.com"
    }
)

data = response.json()
print(data["data"][:200])  # First 200 chars of response body
```

## Node.js

Использование встроенного `fetch` (Node 18+):

```javascript
const response = await fetch('https://eu.api.foura.ai/api/single/', {
  method: 'POST',
  headers: {
    'X-API-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    method: 'GET',
    url: 'https://example.com'
  })
});

const result = await response.json();
console.log(result.data.slice(0, 200));
```

## cURL

Самый простой способ тестирования из командной строки:

```bash
curl -X POST https://eu.api.foura.ai/api/single/ \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"method": "GET", "url": "https://example.com"}'
```

## Go

```go
package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "io"
    "net/http"
)

func main() {
    payload, _ := json.Marshal(map[string]string{
        "method": "GET",
        "url":    "https://example.com",
    })

    req, _ := http.NewRequest("POST", "https://eu.api.foura.ai/api/single/", bytes.NewBuffer(payload))
    req.Header.Set("X-API-Key", "YOUR_API_KEY")
    req.Header.Set("Content-Type", "application/json")

    resp, _ := http.DefaultClient.Do(req)
    defer resp.Body.Close()
    body, _ := io.ReadAll(resp.Body)
    fmt.Println(string(body))
}
```

## Ruby

```ruby
require 'net/http'
require 'json'
require 'uri'

uri = URI('https://eu.api.foura.ai/api/single/')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::Post.new(uri)
request['X-API-Key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = { method: 'GET', url: 'https://example.com' }.to_json

response = http.request(request)
puts JSON.parse(response.body)['data'][0..200]
```

## MCP Server (для агентов LLM)

Если вы создаете агента LLM (Claude Desktop, Claude Code, Cursor, Windsurf, VS Code), пропустите базовый HTTP клиент и используйте [`@fouradata/mcp` сервер](https://foura.ai/docs/mcp/server). Он предоставляет все четыре endpoint FourA как нативные инструменты [Model Context Protocol](https://modelcontextprotocol.io) (`foura_auto`, `foura_single`, `foura_proxy`, `foura_browser`) с типизированными ответами, поэтому агент может выбрать правильный метод без написания вами связующего кода.

Минимальная конфигурация для Claude Desktop:

```json
{
  "mcpServers": {
    "foura": {
      "command": "npx",
      "args": ["-y", "@fouradata/mcp"],
      "env": { "FOURA_API_KEY": "pk_live_..." }
    }
  }
}
```

Полная настройка для каждого поддерживаемого клиента: [MCP Server](https://foura.ai/docs/mcp/server).

## Следующие шаги

- [Быстрый старт](https://foura.ai/docs/getting-started/quick-start): Ваш первый запрос
- [Аутентификация](https://foura.ai/docs/getting-started/authentication): Получение вашего ключа API
- [API Endpoints](https://foura.ai/docs/api/endpoints): Полный справочник
- [MCP Server](https://foura.ai/docs/mcp/server): Использование FourA как набора инструментов MCP
