Skip to content

Latest commit

 

History

History
251 lines (168 loc) · 8.07 KB

File metadata and controls

251 lines (168 loc) · 8.07 KB

Unifapi\Sdk\BrowserApi

All URIs are relative to https://api.unifapi.com, except if the operation defines another base path.

Method HTTP request Description
browserHtmlPost() POST /browser/html Render a page to HTML
browserLinksPost() POST /browser/links Extract links from a page
browserMarkdownPost() POST /browser/markdown Render a page to Markdown
browserScreenshotPost() POST /browser/screenshot Capture a page screenshot

browserHtmlPost()

browserHtmlPost($browser_html_request): \Unifapi\\Sdk\Model\BrowserHtmlPost200Response

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

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Unifapi\\Sdk\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Unifapi\\Sdk\Api\BrowserApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$browser_html_request = new \Unifapi\\Sdk\Model\BrowserHtmlRequest(); // \Unifapi\\Sdk\Model\BrowserHtmlRequest

try {
    $result = $apiInstance->browserHtmlPost($browser_html_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BrowserApi->browserHtmlPost: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
browser_html_request \Unifapi\Sdk\Model\BrowserHtmlRequest [optional]

Return type

\Unifapi\Sdk\Model\BrowserHtmlPost200Response

Authorization

bearerAuth

HTTP request headers

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

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

browserLinksPost()

browserLinksPost($browser_links_request): \Unifapi\\Sdk\Model\BrowserLinksPost200Response

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

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Unifapi\\Sdk\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Unifapi\\Sdk\Api\BrowserApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$browser_links_request = new \Unifapi\\Sdk\Model\BrowserLinksRequest(); // \Unifapi\\Sdk\Model\BrowserLinksRequest

try {
    $result = $apiInstance->browserLinksPost($browser_links_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BrowserApi->browserLinksPost: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
browser_links_request \Unifapi\Sdk\Model\BrowserLinksRequest [optional]

Return type

\Unifapi\Sdk\Model\BrowserLinksPost200Response

Authorization

bearerAuth

HTTP request headers

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

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

browserMarkdownPost()

browserMarkdownPost($browser_markdown_request): \Unifapi\\Sdk\Model\BrowserMarkdownPost200Response

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

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Unifapi\\Sdk\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Unifapi\\Sdk\Api\BrowserApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$browser_markdown_request = new \Unifapi\\Sdk\Model\BrowserMarkdownRequest(); // \Unifapi\\Sdk\Model\BrowserMarkdownRequest

try {
    $result = $apiInstance->browserMarkdownPost($browser_markdown_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BrowserApi->browserMarkdownPost: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
browser_markdown_request \Unifapi\Sdk\Model\BrowserMarkdownRequest [optional]

Return type

\Unifapi\Sdk\Model\BrowserMarkdownPost200Response

Authorization

bearerAuth

HTTP request headers

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

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

browserScreenshotPost()

browserScreenshotPost($browser_screenshot_request): \Unifapi\\Sdk\Model\BrowserScreenshotPost200Response

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

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = Unifapi\\Sdk\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Unifapi\\Sdk\Api\BrowserApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$browser_screenshot_request = new \Unifapi\\Sdk\Model\BrowserScreenshotRequest(); // \Unifapi\\Sdk\Model\BrowserScreenshotRequest

try {
    $result = $apiInstance->browserScreenshotPost($browser_screenshot_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BrowserApi->browserScreenshotPost: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
browser_screenshot_request \Unifapi\Sdk\Model\BrowserScreenshotRequest [optional]

Return type

\Unifapi\Sdk\Model\BrowserScreenshotPost200Response

Authorization

bearerAuth

HTTP request headers

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

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