Note: This feature is currently enabled for selected users only. To request access, please contact us at info@olostep.com.
With contexts you can pass custom cookies to the API. This allows you to reuse cookies, authentication, and stored data to power AI automations.

Creating a Context

Here is how you can create a context to pass custom cookies to the API:
  1. Install the Olostep browser plugin from here: Olostep browser plugin
  2. Visit the website for which you want to save the cookies/authentication
  3. Login to the website with the credentials you want to save
  4. Click on the Olostep plugin icon and select “Submit Context”
  5. Copy the context_id (which will be something like ctx_yylqbfayto) from the plugin and use it in your API requests

Using Context in the API requests

import requests
import json

url = "https://api.olostep.com/v1/scrapes"

payload = {
    "url_to_scrape": "https://www.feizy.com/account-dashboard",
    "formats": ["html", "markdown"],
    "remove_css_selectors": "none",
    "country": "US",
    "context": {
        "id": "ctx_yylqbfayto"
    }
}

headers = {
    "Authorization": "Bearer <API_KEY>",
    "Content-Type": "application/json"
}

response = requests.request("POST", url, json=payload, headers=headers)

# Parse the JSON response
data = response.json()

# Print the JSON with proper indentation
print(json.dumps(data, indent=4))

Conclusion

This feature allows you to reuse cookies, authentication, and stored data for your API requests. This feature is in Beta for companies building AI automations. To get access to this feature reach out to us at info@olostep.com