Quick actions API
A Quick action opens a web page and returns the result in one request, with no session to manage. These endpoints create a PDF, scrape a page and capture a screenshot. For the base URL and authentication, see API conventions. For the error codes, see Errors.
The first example is a complete program. The later examples use its client.
Endpoints
Create a PDF
POST/v1/pdf
Opens a web page and returns the URL of a PDF of it.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
url | string (uri) · body | Yes | The URL of the page. |
delay | number · body | No | Milliseconds to wait before Steel creates the PDF. |
useProxy | boolean · body | No | Use a Steel residential proxy. |
projectId | string (uuid) · body | No | The project to run the action in. Required with an organization key. |
Response
| Field | Type | Description |
|---|---|---|
url | string (uri) | The URL of the PDF. |
See PDF.
curl -X POST https://api.steel.dev/v1/pdf \
-H "steel-api-key: $STEEL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com"}'import Steel from "steel-sdk";
const client = new Steel();
const result = await client.pdf({ url: "https://example.com" });
console.log(result.url);from steel import Steel
client = Steel()
result = client.pdf(url="https://example.com")
print(result.url)package main
import (
"context"
"fmt"
"log"
"github.com/steel-dev/sdk/go"
)
func main() {
if err := run(context.Background()); err != nil {
log.Fatal(err)
}
}
func run(ctx context.Context) error {
client := steel.NewClient()
result, err := client.Pdf(ctx, steel.PdfParams{
URL: steel.F("https://example.com"),
})
if err != nil {
return err
}
fmt.Println(result.URL)
return nil
}#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = steel_rs::Client::new();
let result = client
.pdf(steel_rs::PdfParams::new("https://example.com".to_owned()))
.await?;
println!("{}", result.url);
Ok(())
}Scrape a page
POST/v1/scrape
Opens a web page and returns its content in the formats that you ask for, with its metadata and links.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
url | string · body | Yes | The URL of the page. A URL without a scheme is fetched over HTTPS. |
format | string[] · body | No | The formats of the content: html, readability, cleaned_html or markdown.Default ["html"]. |
screenshot | boolean · body | No | Add a screenshot to the response. |
pdf | boolean · body | No | Add a PDF to the response. |
delay | number · body | No | Milliseconds to wait before Steel scrapes the page. |
useProxy | boolean · body | No | Use a Steel residential proxy. |
projectId | string (uuid) · body | No | The project to run the action in. Required with an organization key. |
Response
| Field | Type | Description |
|---|---|---|
content | object | The content in each format that you asked for: html, cleaned_html, markdown and readability. |
metadata | object | The page metadata, such as title, description, language, canonical, the Open Graph fields, jsonLd and statusCode, the HTTP status of the page. |
links | object[] | The links on the page, each with url and text. |
screenshot | object | With screenshot: true: the url of the screenshot. |
pdf | object | With pdf: true: the url of the PDF. |
See Scrape.
curl -X POST https://api.steel.dev/v1/scrape \
-H "steel-api-key: $STEEL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "format": ["markdown"]}'const result = await client.scrape({
url: "https://example.com",
format: ["markdown"],
});
console.log(result.content.markdown);result = client.scrape(
url="https://example.com",
format=["markdown"],
)
print(result.content.markdown)result, err := client.Scrape(ctx, steel.ScrapeParams{
URL: steel.F("https://example.com"),
Format: steel.F([]steel.ScrapeParamsFormat{steel.ScrapeParamsFormatMarkdown}),
})
if err != nil {
return err
}
fmt.Println(result.Content.Markdown)let result = client
.scrape(steel_rs::ScrapeParams {
format: Some(vec![steel_rs::ScrapeParamsFormat::Markdown]),
..steel_rs::ScrapeParams::new("https://example.com".to_owned())
})
.await?;
let markdown = result.content.markdown.unwrap_or_default();
println!("{markdown}");Capture a screenshot
POST/v1/screenshot
Opens a web page and returns the URL of a screenshot of it.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
url | string (uri) · body | Yes | The URL of the page. |
fullPage | boolean · body | No | Capture the whole page, not only the viewport.Default false. |
delay | number · body | No | Milliseconds to wait before Steel captures the screenshot. |
useProxy | boolean · body | No | Use a Steel residential proxy. |
projectId | string (uuid) · body | No | The project to run the action in. Required with an organization key. |
Response
| Field | Type | Description |
|---|---|---|
url | string (uri) | The URL of the screenshot. |
See Screenshot.
curl -X POST https://api.steel.dev/v1/screenshot \
-H "steel-api-key: $STEEL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "fullPage": true}'const result = await client.screenshot({
url: "https://example.com",
fullPage: true,
});
console.log(result.url);result = client.screenshot(
url="https://example.com",
full_page=True,
)
print(result.url)result, err := client.Screenshot(ctx, steel.ScreenshotParams{
URL: steel.F("https://example.com"),
FullPage: steel.F(true),
})
if err != nil {
return err
}
fmt.Println(result.URL)let result = client
.screenshot(steel_rs::ScreenshotParams {
full_page: Some(true),
..steel_rs::ScreenshotParams::new("https://example.com".to_owned())
})
.await?;
println!("{}", result.url);