Spaces:
Running
Running
Update README.md
Browse files
README.md
CHANGED
|
@@ -15,7 +15,7 @@ This document describes how to use the Browser API to search the web and scrape
|
|
| 15 |
|
| 16 |
## API Endpoint
|
| 17 |
|
| 18 |
-
The primary endpoint for this API is `/
|
| 19 |
|
| 20 |
## Authentication
|
| 21 |
|
|
@@ -23,7 +23,7 @@ This API is public and does not require authentication.
|
|
| 23 |
|
| 24 |
## Actions
|
| 25 |
|
| 26 |
-
The API can perform two main actions: `Search` and `Scrape
|
| 27 |
|
| 28 |
### Search
|
| 29 |
|
|
@@ -39,7 +39,7 @@ The request body must be a JSON object with the following structure:
|
|
| 39 |
|
| 40 |
```json
|
| 41 |
{
|
| 42 |
-
"action": "Search" | "Scrape
|
| 43 |
"query": "string",
|
| 44 |
"browser_name": "firefox" | "chromium" | "webkit",
|
| 45 |
"search_engine_name": "string"
|
|
@@ -48,7 +48,7 @@ The request body must be a JSON object with the following structure:
|
|
| 48 |
|
| 49 |
**Parameters:**
|
| 50 |
|
| 51 |
-
* `action` (string, required): The action to perform. Must be either `"Search"` or `"Scrape
|
| 52 |
* `query` (string, required): The search query or the URL to scrape.
|
| 53 |
* `browser_name` (string, optional): The browser to use for the operation. Defaults to `"firefox"`.
|
| 54 |
* Available options: `"firefox"`, `"chromium"`, `"webkit"`.
|
|
@@ -65,7 +65,7 @@ The API will return a JSON object with the results of the operation.
|
|
| 65 |
{
|
| 66 |
"status": "success",
|
| 67 |
"query": "your_query",
|
| 68 |
-
"action": "Search" | "Scrape
|
| 69 |
"final_url": "https://example.com",
|
| 70 |
"page_title": "Example Domain",
|
| 71 |
"http_status": 200,
|
|
@@ -101,7 +101,7 @@ curl -X POST -H "Content-Type: application/json" \
|
|
| 101 |
"browser_name": "chromium",
|
| 102 |
"search_engine_name": "Google"
|
| 103 |
}' \
|
| 104 |
-
https://broadfield-dev-browser.hf.space/
|
| 105 |
```
|
| 106 |
|
| 107 |
### Example 2: Scraping a URL
|
|
@@ -115,7 +115,7 @@ curl -X POST -H "Content-Type: application/json" \
|
|
| 115 |
"query": "https://en.wikipedia.org/wiki/Web_scraping",
|
| 116 |
"browser_name": "firefox"
|
| 117 |
}' \
|
| 118 |
-
https://broadfield-dev-browser.hf.space/
|
| 119 |
```
|
| 120 |
|
| 121 |
## Supported Search Engines
|
|
|
|
| 15 |
|
| 16 |
## API Endpoint
|
| 17 |
|
| 18 |
+
The primary endpoint for this API is `/web_browse`. This is a `POST` endpoint that accepts a JSON payload.
|
| 19 |
|
| 20 |
## Authentication
|
| 21 |
|
|
|
|
| 23 |
|
| 24 |
## Actions
|
| 25 |
|
| 26 |
+
The API can perform two main actions: `Search` and `Scrape`.
|
| 27 |
|
| 28 |
### Search
|
| 29 |
|
|
|
|
| 39 |
|
| 40 |
```json
|
| 41 |
{
|
| 42 |
+
"action": "Search" | "Scrape",
|
| 43 |
"query": "string",
|
| 44 |
"browser_name": "firefox" | "chromium" | "webkit",
|
| 45 |
"search_engine_name": "string"
|
|
|
|
| 48 |
|
| 49 |
**Parameters:**
|
| 50 |
|
| 51 |
+
* `action` (string, required): The action to perform. Must be either `"Search"` or `"Scrape"`.
|
| 52 |
* `query` (string, required): The search query or the URL to scrape.
|
| 53 |
* `browser_name` (string, optional): The browser to use for the operation. Defaults to `"firefox"`.
|
| 54 |
* Available options: `"firefox"`, `"chromium"`, `"webkit"`.
|
|
|
|
| 65 |
{
|
| 66 |
"status": "success",
|
| 67 |
"query": "your_query",
|
| 68 |
+
"action": "Search" | "Scrape",
|
| 69 |
"final_url": "https://example.com",
|
| 70 |
"page_title": "Example Domain",
|
| 71 |
"http_status": 200,
|
|
|
|
| 101 |
"browser_name": "chromium",
|
| 102 |
"search_engine_name": "Google"
|
| 103 |
}' \
|
| 104 |
+
https://broadfield-dev-browser-api.hf.space/web_browse
|
| 105 |
```
|
| 106 |
|
| 107 |
### Example 2: Scraping a URL
|
|
|
|
| 115 |
"query": "https://en.wikipedia.org/wiki/Web_scraping",
|
| 116 |
"browser_name": "firefox"
|
| 117 |
}' \
|
| 118 |
+
https://broadfield-dev-browser-api.hf.space/web_browse
|
| 119 |
```
|
| 120 |
|
| 121 |
## Supported Search Engines
|