You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

olostep-sdk

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

olostep-sdk

Official Python SDK for Olostep Web Scraping API

0.1.2
pipPyPI
Maintainers
1

Olostep SDK

A lightweight Python SDK for interacting with the Olostep scraping, crawling, and batching API.

🚀 Installation

Install from PyPI:

pip install olostep-sdk

🧰 Features

  • Scrape single URLs with different parsers
  • Batch process multiple items
  • Crawl starting from a URL
  • Retrieve and parse content in multiple formats (JSON, Markdown, etc.)

🔑 Getting Started

First, initialize the SDK with your API token:

from olostep_sdk import OlostepClient
from olostep_sdk.services.scrape import ScrapeService
from olostep_sdk.enums import OlostepParser, Format

client = OlostepClient(api_token="your-api-token")
scraper = ScrapeService(client)

🔍 Scrape a URL

result = scraper.scrape(
    url="https://example.com",
    parser=OlostepParser.GOOGLE_SEARCH
)
print(result)

📦 Start a Batch

from olostep_sdk.services.batch import BatchService

batch = BatchService(client)
batch_id = batch.start_batch([
    {"url": "https://example1.com"},
    {"url": "https://example2.com"}
])
batch.wait_until_complete(batch_id)
items = batch.get_items(batch_id)

🌐 Crawl a Website

from olostep_sdk.services.crawl import CrawlService

crawler = CrawlService(client)
crawl_id = crawler.start_crawl("https://example.com")
crawler.wait_until_complete(crawl_id)
results = crawler.get_items(crawl_id)

📄 Formats and Parsers

from olostep_sdk.enums import Format, OlostepParser

Format.MARKDOWN
Format.JSON

OlostepParser.GOOGLE_SEARCH
OlostepParser.BASIC

🧪 Running Tests

python -m unittest discover -s tests

📬 License

This project is licensed under the MIT License.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts