browser / README.md
broadfield-dev's picture
Update README.md
383c5ed verified
|
raw
history blame
1.26 kB
metadata
title: Browser
emoji: 🦀
colorFrom: purple
colorTo: indigo
sdk: gradio
sdk_version: 5.34.2
app_file: app.py
pinned: false

Browser API

This document describes how to use the Browser API to search the web and scrape website content. The API is built with Gradio and Playwright, providing a simple interface for web automation tasks.

API Endpoint

The primary endpoint for this API is /api/web_browse. This is a POST endpoint that accepts a JSON payload.

Authentication

This API is public and does not require authentication.

Actions

The API can perform two main actions: Search and Scrape URL.

Search

The Search action allows you to perform a web search using a specified search engine. The API will return the content of the search results page in Markdown format.

Scrape URL

The Scrape URL action allows you to retrieve the content of a specific URL. The API will fetch the page, process the HTML, and return the main content in a clean, readable Markdown format.

Request Body

The request body must be a JSON object with the following structure:

{
  "action": "Search" | "Scrape URL",
  "query": "string",
  "browser_name": "firefox" | "chromium" | "webkit",
  "search_engine_name": "string"
}