About this endpoint
What it does
Generates a preview for a URL by fetching the page metadata and returning it in a JSON data object. If the URL is detected as malicious while secure_mode is enabled, the response follows the malicious-URL shape instead of the normal preview metadata shape.
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| url | String | Yes | The URL to generate a preview for. Protocol is optional; http:// is prepended if absent. |
| user_agent | String | No | Custom User-Agent header sent when fetching the URL. |
| secure_mode | Boolean | No | When true, the URL is checked against the malicious-URL database before fetching. Default: true. |
| accept_language | String | No | Custom Accept-Language header sent when fetching the URL. |
| allow_redirects | Boolean | No | Whether to follow HTTP redirects when fetching the URL. Default: false. |
| images_property_type | ENUM | No | Preferred image meta-tag property to extract. Allowed values: og, twitter. Default: og. |
Response
Returns a JSON object with a required data field. data is either a preview metadata object or a malicious-URL object, depending on the URL lookup result.
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| data | Object | Yes | Either the normal preview metadata object or the malicious-URL object. |
Notes
If secure_mode is true, reported_malicious is present in the normal preview response and is always false for a clean URL. In the malicious-URL response, reported_malicious is true and the object includes url and threat.