SDKs and Libraries
FourA is a REST API: you can use it with any language that speaks HTTP. Here are quick-start examples in the most popular languages.
Python
Using the requests library:
import requests
response = requests.post(
"https://eu.api.foura.ai/api/v1/tasks",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
json={
"url": "https://example.com",
"type": "single"
}
)
data = response.json()
print(data["content"][:200]) # First 200 chars of HTML
Node.js
Using the built-in fetch (Node 18+):
const response = await fetch('https://eu.api.foura.ai/api/v1/tasks', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
url: 'https://example.com',
type: 'single'
})
});
const data = await response.json();
console.log(data.content.slice(0, 200));
cURL
The simplest way to test from the command line:
curl -X POST https://eu.api.foura.ai/api/v1/tasks \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "type": "single"}'
Go
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
payload, _ := json.Marshal(map[string]string{
"url": "https://example.com",
"type": "single",
})
req, _ := http.NewRequest("POST", "https://eu.api.foura.ai/api/v1/tasks", bytes.NewBuffer(payload))
req.Header.Set("Authorization", "Bearer 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
require 'net/http'
require 'json'
require 'uri'
uri = URI('https://eu.api.foura.ai/api/v1/tasks')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = { url: 'https://example.com', type: 'single' }.to_json
response = http.request(request)
puts JSON.parse(response.body)['content'][0..200]
Official SDKs
We're building official SDKs for Python and Node.js. Join the beta waitlist to get early access.
Next Steps
- Quick Start: Your first request
- Authentication: Get your API key
- API Endpoints: Full reference