> ## Documentation Index
> Fetch the complete documentation index at: https://docs.uniskill.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Web Scrape

> Extract structured data or Markdown from any URL.

## Usage

Use `uniskill_scrape` to convert web pages into high-quality Markdown that AI agents can directly process and understand.

### Parameters

* `url` (string): The target web page URL.
* `format` (string): Response format, options are `markdown` (default) or `html`.

***

## Response Headers

Monitor your usage in real-time with our standard diagnostic headers:

| Header                  | Description                            |
| :---------------------- | :------------------------------------- |
| `X-RateLimit-Limit`     | Your maximum RPM limit.                |
| `X-RateLimit-Remaining` | Remaining calls in the current window. |
| `X-UniSkill-Balance`    | Total remaining credits.               |
| `X-UniSkill-Status`     | Execution status.                      |

***

## Error Handling

Standard HTTP status codes are used to indicate success or failure:

* **200 OK**: Success.
* **401 Unauthorized**: Key is missing or invalid.
* **429 Too Many Requests**: You have hit your RPM limit.
* **402 Payment Required**: Please top up your credits on the dashboard.

```python theme={null}
# Logic: Simple scraping example
import requests

def scrape_page(target_url):
    api_url = "https://api.uniskill.ai/v1/scrape"
    # Header and payload configuration
    headers = {"Authorization": "Bearer YOUR_KEY"}
    payload = {"url": target_url, "format": "markdown"}
    
    response = requests.post(api_url, json=payload, headers=headers)
    return response.json()
```
