Skip to main content
You are viewing the v1 (legacy) documentation. Please migrate to v2 for the latest features.

Prerequisites


Python SDK

pip install scrapegraph-py
from scrapegraph_py import Client

client = Client(api_key="your-api-key-here")

response = client.smartscraper(
    website_url="https://scrapegraphai.com",
    user_prompt="Extract information about the company"
)
print(response)
You can also set the SGAI_API_KEY environment variable and initialize the client without parameters: client = Client()

JavaScript SDK

npm i scrapegraph-js
import { smartScraper } from "scrapegraph-js";

const apiKey = "your-api-key-here";

const response = await smartScraper(apiKey, {
  website_url: "https://scrapegraphai.com",
  user_prompt: "What does the company do?",
});

if (response.status === "error") {
  console.error("Error:", response.error);
} else {
  console.log(response.data.result);
}

Next Steps