Spaces:
Paused
Paused
File size: 1,259 Bytes
085aa8e 383c5ed |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
---
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:
```json
{
"action": "Search" | "Scrape URL",
"query": "string",
"browser_name": "firefox" | "chromium" | "webkit",
"search_engine_name": "string"
} |