← APIs / Extract Links from Webpage API
Verified

Extract Links from Webpage API

ApyHubby ApyHub · Developer Tools

Extract all links from webpages with the Extract Links from Webpage API. Automate scraping, SEO, and data curation pipelines.

dataapi
Price per request
$0.02
Base URL
https://gateway.apiosk.com/apyhub-extract-links
Technical Specs
Auth MethodapiKey
Response FormatJSON
Endpoints1
Endpoints
MethodPathDescriptionCost
POST /extract/links/url Extracts all hyperlinks from the web page at the given URL and returns them as absolute URLs. If `secure_mode` is enabled, the URL is checked against a malicious-URL database before the page is fetched.
$0.02 default
View details
Endpoint documentation
POST/extract/links/url
$0.02 default
Description

Extracts all hyperlinks from the web page at the given URL and returns them as absolute URLs. If `secure_mode` is enabled, the URL is checked against a malicious-URL database before the page is fetched.

Documentation

Extract all links from a web page

**Method:** POST
**Apiosk URL:** https://gateway.apiosk.com/apyhub-extract-links/extract/links/url
**Request content type:** application/json
**Response content type:** application/json

What it does

Extracts all hyperlinks from the web page at the given URL and returns them as absolute URLs. If secure_mode is enabled, the URL is checked against a malicious-URL database before the page is fetched.

Request Body

| Parameter | Type | Mandatory | Description |
| --------- | ---- | --------- | ----------- |
| url | String | Yes | The URL of the page to extract links from. 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. |

Response

Returns a JSON object with a required data field. On a normal response, data is an object containing a links array of strings with the absolute URLs found on the page. If the URL is detected as malicious, data is an object containing url as a string, threat as a string, and reported_malicious as a boolean.

| Parameter | Type | Mandatory | Description |
| --------- | ---- | --------- | ----------- |
| data | Object | Yes | Wrapper object for the result. It can contain either the extracted links or malicious-URL details, depending on the outcome. |
| data.links | String Array | No | Absolute URLs of all hyperlinks found on the page. |
| data.url | String | No | The URL that was flagged as malicious. |
| data.threat | String | No | Threat label returned for the malicious URL. |
| data.reported_malicious | Boolean | No | Indicates whether the URL was reported as malicious. |

Quickstart

Send a webpage URL to extract the links found on that page.

bash
curl -X POST "https://gateway.apiosk.com/apyhub-extract-links/extract/links/url" \
-H "PAYMENT-SIGNATURE: $PAYMENT_SIGNATURE" \
-H "Content-Type: application/json" \
-d '{
"url": "https://apyhub.com"
}'

What you'll get back

Returns a JSON object with a data field. On a normal response, data is an object containing a links array of absolute URLs found on the page; if the URL is flagged as malicious, data is an object with url, threat, and reported_malicious fields.

json
{
"data": {
"links": [
"https://apyhub.com/docs",
"https://apyhub.com/pricing"
]
}
}

Payment and authentication

Do not send an apy-token. Apiosk injects the APYHub credential server-side. The first unpaid request returns HTTP 402 Payment Required with a PAYMENT-REQUIRED header. Sign an accepted USDC payment and retry the same request with the proof in PAYMENT-SIGNATURE (or use an Apiosk/x402-aware agent client that performs this exchange automatically).

The $PAYMENT_SIGNATURE placeholder in the example is the signed proof obtained from that initial 402 response.

Source

Parameter definitions and limits were synchronized from [APYHub's official documentation](https://apyhub.com/apyhub/service/extract-links-from-webpage) on 2026-07-18.

Pricing
$0.02 default
Authentication

Pay per request through Apiosk using x402. Do not send an apy-token; the gateway injects the selected APYHub key server-side.

Request schema
{
  "properties": {
    "accept_language": {
      "description": "Custom Accept-Language header sent when fetching the URL.",
      "example": "en-US,en;q=0.9",
      "type": "string"
    },
    "secure_mode": {
      "default": true,
      "description": "When true, the URL is checked against the malicious-URL database before fetching.",
      "type": "boolean"
    },
    "url": {
      "description": "The URL of the page to extract links from. Protocol is optional — http:// is prepended if absent.",
      "example": "https://apyhub.com",
      "type": "string"
    },
    "user_agent": {
      "description": "Custom User-Agent header sent when fetching the URL.",
      "example": "Mozilla/5.0 (compatible; MyBot/1.0)",
      "type": "string"
    }
  },
  "required": [
    "url"
  ],
  "type": "object"
}
Response schema
{
  "properties": {
    "data": {
      "oneOf": [
        {
          "description": "Extracted links (normal response)",
          "properties": {
            "links": {
              "description": "Absolute URLs of all hyperlinks found on the page.",
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          },
          "type": "object"
        },
        {
          "description": "Malicious URL detected",
          "properties": {
            "reported_malicious": {
              "example": true,
              "type": "boolean"
            },
            "threat": {
              "example": "malware",
              "type": "string"
            },
            "url": {
              "type": "string"
            }
          },
          "type": "object"
        }
      ]
    }
  },
  "required": [
    "data"
  ],
  "type": "object"
}
Headers
{
  "properties": {
    "PAYMENT-SIGNATURE": {
      "description": "Signed x402 v2 payment proof. Obtain the payment requirements from the initial HTTP 402 response.",
      "type": "string"
    }
  },
  "required": [],
  "type": "object"
}
Example request
{
  "secure_mode": true,
  "url": "https://apyhub.com"
}
Example response
{
  "data": {
    "links": [
      "https://apyhub.com/docs",
      "https://apyhub.com/pricing"
    ]
  }
}