{"uid":"cap__AJiJ3KKyPXhRu3VheLt5","slug":"agentshelf-xpath-canonical-href-extractor-fbd02caa","name":"AgentShelf XPath Canonical Href Extractor","description":"Call when an agent needs href of link rel exactly canonical via //link[@rel='canonical']/@href from a public page or HTML (SSRF-safe). Exact $0.004 USDC. Prefer unpaid POST /v1/sandbox/xpath-canonical-href first.","url":"https://agentshelf.syntexa.ch/v1/xpath-canonical-href?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"url":{"type":"string","maxLength":2048,"minLength":8,"description":"Public page to fetch. The selector or profile is fixed by the SKU. Provide url or html."},"html":{"type":"string","examples":["<!doctype html><html lang=\"en\"><head><title>Hello</title>\n<meta name=\"description\" content=\"Desc\"><meta property=\"og:title\" content=\"OG\">\n<link rel=\"canonical\" href=\"https://example.com/\"><link rel=\"icon\" href=\"/favicon.ico\">\n</head><body><h1>Hello</h1><a href=\"https://example.com/a\">A</a></body></html>"],"maxLength":200000,"minLength":1,"description":"HTML to extract from locally. Provide html or url. When both are set, html is used."}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.004","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.004/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_UKP80FRFMCx87u8KGD3C9","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.004","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Extracts the canonical URL from a public webpage or raw HTML using the XPath selector //link[@rel='canonical']/@href","exampleAgentPrompt":"Can you pull the canonical URL from https://example.com/blog/my-post — I need the href value from the link rel='canonical' tag in the page's HTML.","exampleUseCases":[{"title":"SEO canonical audit for a page","prompt":"Check https://www.shopify.com/blog/ecommerce-seo and tell me what canonical URL is declared in the page — I want to see if it points to itself or a different URL."},{"title":"Deduplication check for crawled content","prompt":"I have this HTML snippet from a scraped page — can you find the canonical href in it so I can figure out the authoritative URL before I index it?"},{"title":"Verify canonical tag after redirect","prompt":"After our site migration, can you fetch https://newsite.com/products/widget and confirm what canonical URL is set in the HTML head? I want to make sure the canonical tag was updated correctly."}],"resultDescription":"Returns the value of the href attribute from the first <link rel='canonical'> element found in the page's HTML, resolved via XPath //link[@rel='canonical']/@href. If no canonical tag is present, returns an empty or null result. The response is a string URL representing the declared canonical page.","failureModes":["No canonical link tag exists on the page — returns empty or null result","URL is unreachable or returns non-200 HTTP status — request fails","URL points to a private/metadata IP address — rejected by SSRF protection","HTML input exceeds 200,000 character limit — validation error","Page requires JavaScript rendering — canonical tag may not be present in static HTML","Malformed HTML may cause XPath to fail to locate the tag"],"whenToPreferThis":"Use this endpoint when you specifically need the canonical href from a page's link tags — for SEO auditing, deduplication, or verifying canonical declarations. It is more precise and cheaper than full-page scraping when you only need the canonical URL. Use the sandbox POST /v1/sandbox/xpath-canonical-href first if available to avoid the $0.004 USDC charge.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-01T06:47:43.418Z","isFirstParty":false,"canonicalSlug":"agentshelf-xpath-canonical-href-extractor-fbd02caa"}