Quick start
The API base URL is https://openapi.flowda.ai. All examples below use this address. Set $FLOWDA_API_KEY to the key you created in the flowda console.
1. Check your API key
Verify your key
curl https://openapi.flowda.ai/v1/account \
-H "Authorization: Bearer $FLOWDA_API_KEY"
A response with code: 0 confirms that the key is valid. The data object shows its scopes and quota.
2. Extract a page
Choose your language. Scrape uses the /v1/extract endpoint.
curl https://openapi.flowda.ai/v1/extract \
-H "Authorization: Bearer $FLOWDA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Caching", "formats": ["markdown"]}'
Python
import os
import requests
resp = requests.post(
"https://openapi.flowda.ai/v1/extract",
headers={"Authorization": f"Bearer {os.environ['FLOWDA_API_KEY']}"},
json={"url": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Caching", "formats": ["markdown"]},
timeout=130, # Allow a margin above the 120-second fetch limit
)
body = resp.json()
# The envelope says the call reached us; it does not say the target was retrieved.
# HTTP 200 with code 0 can still carry data.success = false.
if body["code"] != 0:
raise RuntimeError(f"{body['code']} {body['message']} request_id={body['request_id']}")
data = body.get("data") or {}
if data.get("success") is False:
raise RuntimeError(
f"{data.get('code')} {data.get('message')} "
f"request_id={body['request_id']} platform_request_id={data.get('request_id')}"
)
print(data)
Go
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"os"
"time"
)
func main() {
payload, _ := json.Marshal(map[string]any{
"url": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Caching",
"formats": []string{"markdown"},
})
req, _ := http.NewRequest(http.MethodPost, "https://openapi.flowda.ai/v1/extract", bytes.NewReader(payload))
req.Header.Set("Authorization", "Bearer "+os.Getenv("FLOWDA_API_KEY"))
req.Header.Set("Content-Type", "application/json")
client := &http.Client{Timeout: 130 * time.Second}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
var body struct {
Code int `json:"code"`
Message string `json:"message"`
Data json.RawMessage `json:"data"`
RequestID string `json:"request_id"`
}
if err := json.NewDecoder(resp.Body).Decode(&body); err != nil {
panic(err)
}
if body.Code != 0 {
panic(fmt.Sprintf("%d %s request_id=%s", body.Code, body.Message, body.RequestID))
}
// The envelope only says the call reached us. The fetch outcome is data.success:
// a 200 with code 0 can still be a failed retrieval.
var result struct {
Success bool `json:"success"`
Code string `json:"code"`
Message string `json:"message"`
RequestID string `json:"request_id"`
}
if err := json.Unmarshal(body.Data, &result); err != nil {
panic(err)
}
if !result.Success {
panic(fmt.Sprintf("%s %s request_id=%s platform_request_id=%s",
result.Code, result.Message, body.RequestID, result.RequestID))
}
fmt.Println(string(body.Data))
}
3. Next steps
- Read about the response format and error codes. The Python and Go examples check
data.successas well as the outercode, which is what every capability call needs. - To monitor page changes, see Webhooks.
- Working from an AI agent, an IDE, or a terminal? Agent tools covers the hosted MCP server, Agent Skills, and the CLI.
- Find all endpoint parameters in the API Reference.