Broken Links
The broken links endpoint returns all broken links detected on a monitor with the broken links check enabled. To configure the broken links check settings (whitelist URLs, link types, etc.), use the monitors endpoint.
You'll need a monitor ID for this endpoint.
Example request:
$ OHDEAR_TOKEN="your API token" $ curl https://ohdear.app/api/broken-links/1 \ -H "Authorization: Bearer $OHDEAR_TOKEN" \ -H 'Accept: application/json' \ -H 'Content-Type: application/json'
All endpoints below follow the same authentication pattern.
Get broken links for a monitor #
GET /api/broken-links/{monitorId}
Returns all broken links from the latest completed crawl run.
Here's what the response looks like:
{ "data": [ { "status_code": 404, "crawled_url": "https://example.com/broken", "relative_crawled_url": "/broken", "found_on_url": "https://example.com", "relative_found_on_url": "/", "link_text": "Click here", "internal": true } ] }
status_code: the HTTP status code returned by the broken linkcrawled_url: the full URL of the broken linkrelative_crawled_url: the relative path of the broken linkfound_on_url: the page where the broken link was foundrelative_found_on_url: the relative path of the page containing the broken linklink_text: the anchor text or alt text of the linkinternal: whether the broken link points to the same domain (true) or an external site (false)
Was this page helpful?
Feel free to reach out via [email protected] or on X via @OhDearApp if you have any other questions. We'd love to help!