Skip to content

Latest commit

 

History

History
360 lines (256 loc) · 12.6 KB

File metadata and controls

360 lines (256 loc) · 12.6 KB

unifapi.BrowserApi

All URIs are relative to https://api.unifapi.com

Method HTTP request Description
browser_html_post POST /browser/html Render a page to HTML
browser_links_post POST /browser/links Extract links from a page
browser_markdown_post POST /browser/markdown Render a page to Markdown
browser_screenshot_post POST /browser/screenshot Capture a page screenshot

browser_html_post

BrowserHtmlPost200Response browser_html_post(browser_html_request=browser_html_request)

Render a page to HTML

Render a URL in a headless browser and return the fully rendered HTML after JavaScript execution — use it to read meta tags, structured data, and content that only appears after client-side rendering.

Example

  • Bearer Authentication (bearerAuth):
import unifapi
from unifapi.models.browser_html_post200_response import BrowserHtmlPost200Response
from unifapi.models.browser_html_request import BrowserHtmlRequest
from unifapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.unifapi.com
# See configuration.py for a list of all supported configuration parameters.
configuration = unifapi.Configuration(
    host = "https://api.unifapi.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = unifapi.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with unifapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = unifapi.BrowserApi(api_client)
    browser_html_request = unifapi.BrowserHtmlRequest() # BrowserHtmlRequest |  (optional)

    try:
        # Render a page to HTML
        api_response = api_instance.browser_html_post(browser_html_request=browser_html_request)
        print("The response of BrowserApi->browser_html_post:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling BrowserApi->browser_html_post: %s\n" % e)

Parameters

Name Type Description Notes
browser_html_request BrowserHtmlRequest [optional]

Return type

BrowserHtmlPost200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

browser_links_post

BrowserLinksPost200Response browser_links_post(browser_links_request=browser_links_request)

Extract links from a page

Render a URL in a headless browser and return every link on the page as absolute URLs, including links injected by JavaScript. Optionally restrict to visible links or same-domain links for internal-link and broken-link audits.

Example

  • Bearer Authentication (bearerAuth):
import unifapi
from unifapi.models.browser_links_post200_response import BrowserLinksPost200Response
from unifapi.models.browser_links_request import BrowserLinksRequest
from unifapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.unifapi.com
# See configuration.py for a list of all supported configuration parameters.
configuration = unifapi.Configuration(
    host = "https://api.unifapi.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = unifapi.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with unifapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = unifapi.BrowserApi(api_client)
    browser_links_request = unifapi.BrowserLinksRequest() # BrowserLinksRequest |  (optional)

    try:
        # Extract links from a page
        api_response = api_instance.browser_links_post(browser_links_request=browser_links_request)
        print("The response of BrowserApi->browser_links_post:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling BrowserApi->browser_links_post: %s\n" % e)

Parameters

Name Type Description Notes
browser_links_request BrowserLinksRequest [optional]

Return type

BrowserLinksPost200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

browser_markdown_post

BrowserMarkdownPost200Response browser_markdown_post(browser_markdown_request=browser_markdown_request)

Render a page to Markdown

Render a URL in a headless browser (running JavaScript) and return the page as clean Markdown — ideal for content analysis, summarization, and feeding pages to language models.

Example

  • Bearer Authentication (bearerAuth):
import unifapi
from unifapi.models.browser_markdown_post200_response import BrowserMarkdownPost200Response
from unifapi.models.browser_markdown_request import BrowserMarkdownRequest
from unifapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.unifapi.com
# See configuration.py for a list of all supported configuration parameters.
configuration = unifapi.Configuration(
    host = "https://api.unifapi.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = unifapi.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with unifapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = unifapi.BrowserApi(api_client)
    browser_markdown_request = unifapi.BrowserMarkdownRequest() # BrowserMarkdownRequest |  (optional)

    try:
        # Render a page to Markdown
        api_response = api_instance.browser_markdown_post(browser_markdown_request=browser_markdown_request)
        print("The response of BrowserApi->browser_markdown_post:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling BrowserApi->browser_markdown_post: %s\n" % e)

Parameters

Name Type Description Notes
browser_markdown_request BrowserMarkdownRequest [optional]

Return type

BrowserMarkdownPost200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

browser_screenshot_post

BrowserScreenshotPost200Response browser_screenshot_post(browser_screenshot_request=browser_screenshot_request)

Capture a page screenshot

Render a URL in a headless browser and capture a screenshot, returned as a base64-encoded image. Control the viewport, capture the full scrollable page, target a CSS selector, and choose png, jpeg, or webp output.

Example

  • Bearer Authentication (bearerAuth):
import unifapi
from unifapi.models.browser_screenshot_post200_response import BrowserScreenshotPost200Response
from unifapi.models.browser_screenshot_request import BrowserScreenshotRequest
from unifapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.unifapi.com
# See configuration.py for a list of all supported configuration parameters.
configuration = unifapi.Configuration(
    host = "https://api.unifapi.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = unifapi.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with unifapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = unifapi.BrowserApi(api_client)
    browser_screenshot_request = unifapi.BrowserScreenshotRequest() # BrowserScreenshotRequest |  (optional)

    try:
        # Capture a page screenshot
        api_response = api_instance.browser_screenshot_post(browser_screenshot_request=browser_screenshot_request)
        print("The response of BrowserApi->browser_screenshot_post:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling BrowserApi->browser_screenshot_post: %s\n" % e)

Parameters

Name Type Description Notes
browser_screenshot_request BrowserScreenshotRequest [optional]

Return type

BrowserScreenshotPost200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

[Back to top] [Back to API list] [Back to Model list] [Back to README]