Check whether a URL is a phishing or scam site with ThreatDetector.url(), returning an ALLOWED, BLOCKED, UNKNOWN or IGNORED status plus an optional redirectUrl.
Only the domain portion of the URL is checked. The path and query string are
stripped before sending the request to the ChainPatrol API to preserve privacy
and prevent leaking sensitive information.
The URL to check. This can be a full URL or a domain. The URL will be
parsed to extract only the domain for checking.Ex. https://google.com or google.com
The status property indicates whether the URL is allowed or blocked.
It is IGNORED when the domain was added with
ignore(), for example
after a user chose to continue at their own risk.
The redirectUrl property specifies where to redirect the user when the
detector detects a threat. This property will only be present if the
status property is set to BLOCKED.By default, the detector returns the ChainPatrol warning page,
https://app.chainpatrol.io/preview, with the checked URL in the target
and originUrl query parameters. You can override this by passing your
own redirectUrl when creating the ThreatDetector.
{"docsConfig":{"theme":"palm","$schema":"https://mintlify.com/docs.json","name":"ChainPatrol","colors":{"primary":"#6622DC","light":"#985EFD","dark":"#2A186B"},"logo":{"light":"https://mintcdn.com/chainpatrol/R_CITzEDbsciFTsn/logo/light.svg?fit=max\u0026auto=format\u0026n=R_CITzEDbsciFTsn\u0026q=85\u0026s=8ca4a8411113008ec8f9a57dec249989","dark":"https://mintcdn.com/chainpatrol/R_CITzEDbsciFTsn/logo/dark.svg?fit=max\u0026auto=format\u0026n=R_CITzEDbsciFTsn\u0026q=85\u0026s=3fba0f7cf94681111da5d1ce52ebf33b","href":"https://chainpatrol.com"},"favicon":"https://mintcdn.com/chainpatrol/R_CITzEDbsciFTsn/favicon.svg?fit=max\u0026auto=format\u0026n=R_CITzEDbsciFTsn\u0026q=85\u0026s=2ee94dcfc07708e2929aad42ea5ab4c5","api":{"openapi":"https://app.chainpatrol.io/api/v2/openapi.json?v=2","mdx":{"auth":{"method":"key","name":"X-API-KEY"},"server":"https://app.chainpatrol.io/api/v2"}},"appearance":{"default":"dark"},"background":{"image":"https://mintcdn.com/chainpatrol/oLEHOzLMXL0CWKrg/background.png?fit=max\u0026auto=format\u0026n=oLEHOzLMXL0CWKrg\u0026q=85\u0026s=562d8e2e01dbe50733cb041efde433a6","color":{"dark":"#060114"}},"navbar":{"links":[{"href":"https://chainpatrol.com/blog","label":"Blog"},{"href":"https://chainpatrol.com/changelog","label":"Changelog"}],"primary":{"type":"button","label":"Dashboard","href":"https://app.chainpatrol.io/"}},"footer":{"socials":{"x":"https://x.com/chainpatrol","linkedin":"https://www.linkedin.com/company/89545915","github":"https://github.com/chainpatrol"}},"fonts":{"heading":{"family":"IBM Plex Sans"},"body":{"family":"Inter"}},"integrations":{"ga4":{"measurementId":"G-QEBBHCD92K"}},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"chainpatrol","hasAudioNarration":false,"actualSubdomain":"chainpatrol","customDomains":["chainpatrol.com"],"gitSource":{"type":"github","owner":"chainpatrol","repo":"docs","deployBranch":"main","contentDirectory":"","mountPath":"","label":""},"feedback":{"thumbs":true,"edits":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6aef6642ff56dc66d2b76831","clientVersion":"0.0.4087","searchFilterCounts":[{"language":"default","tag":"API Reference","count":105},{"language":"default","tag":"Documentation","count":29},{"language":"default","tag":"Integrations","count":24},{"language":"default","tag":"JavaScript SDK","count":22},{"language":"default","tag":"Getting Started","count":20},{"language":"default","tag":"CLI","count":16},{"language":"default","tag":"Concepts","count":14},{"language":"default","tag":"Assets","count":13},{"language":"default","tag":"Threat Detection","count":13},{"language":"default","tag":"Metrics","count":12}]},"assistantConfig":{},"basePath":"/docs","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[],"page":{"pagePath":"sdk/threat-detector/instance-methods/url","slug":"/sdk/threat-detector/instance-methods/url","pageMetadata":{"title":"url()","description":"Check whether a URL is a phishing or scam site with ThreatDetector.url(), returning an ALLOWED, BLOCKED, UNKNOWN or IGNORED status plus an optional redirectUrl.","href":"/sdk/threat-detector/instance-methods/url"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Check whether a URL is a phishing or scam site with ThreatDetector.url(), returning an ALLOWED, BLOCKED, UNKNOWN or IGNORED status plus an optional redirectUrl.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,CodeGroup,Expandable,Heading,Note,ParamField}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);return _jsxs(_Fragment,{children:[_jsx(Note,{children:_jsx(_components.p,{children:`Only the domain portion of the URL is checked. The path and query string are\nstripped before sending the request to the ChainPatrol API to preserve privacy\nand prevent leaking sensitive information.`})}),`\n`,_jsx(Heading,{level:`2`,id:`example`,children:`Example`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Code`,numberOfLines:`3`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` result`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` detector`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`url`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://www.mountaintop-finance.com\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Output (Allowed)`,numberOfLines:`5`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#C8C8C8`},children:` ok`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#C8C8C8`},children:` url`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"mountaintop-finance.com\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#C8C8C8`},children:` status`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ALLOWED\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Output (Blocked)`,numberOfLines:`6`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#C8C8C8`},children:` ok`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#C8C8C8`},children:` url`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"mountaintop-finance.com\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#C8C8C8`},children:` status`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"BLOCKED\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#C8C8C8`},children:` redirectUrl`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://app.chainpatrol.io/preview?target=https%3A%2F%2Fwww.mountaintop-finance.com\u0026originUrl=https%3A%2F%2Fwww.mountaintop-finance.com\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Output (Ignored)`,numberOfLines:`5`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#C8C8C8`},children:` ok`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#C8C8C8`},children:` url`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://www.mountaintop-finance.com\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#C8C8C8`},children:` status`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"IGNORED\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Output (Error)`,numberOfLines:`5`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#C8C8C8`},children:` ok`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#C8C8C8`},children:` url`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"abcdefgh\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#C8C8C8`},children:` error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Unable to parse domain\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})]}),`\n`,_jsx(Heading,{level:`2`,id:`parameters`,children:`Parameters`}),`\n`,_jsxs(ParamField,{body:`url`,type:`string`,required:true,id:`param-url`,children:[_jsx(_components.p,{children:`The URL to check. This can be a full URL or a domain. The URL will be\nparsed to extract only the domain for checking.`}),_jsxs(_components.p,{children:[`Ex. `,_jsx(_components.code,{children:`https://google.com`}),` or `,_jsx(_components.code,{children:`google.com`})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`return-value`,children:`Return Value`}),`\n`,_jsx(_components.p,{children:`The return value is a promise that resolves with an object containing the\nresult of the check.`}),`\n`,_jsx(Heading,{level:`3`,id:`success`,children:`Success`}),`\n`,_jsx(_components.p,{children:`If the check was successful, the object will contain the following properties:`}),`\n`,_jsx(ParamField,{body:`result`,type:`object`,required:true,id:`param-result`,children:_jsxs(Expandable,{title:`properties`,defaultOpen:true,children:[_jsx(ParamField,{body:`ok`,type:`true`,required:true,id:`param-ok`,children:_jsxs(_components.p,{children:[`This property will be `,_jsx(_components.code,{children:`true`}),` if the check was successful.`]})}),_jsx(ParamField,{body:`url`,type:`string`,id:`param-url-1`,children:_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`url`}),` property is the URL that was checked.`]})}),_jsx(ParamField,{body:`status`,type:`'ALLOWED' | 'BLOCKED' | 'UNKNOWN' | 'IGNORED'`,required:true,id:`param-status`,children:_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`status`}),` property indicates whether the URL is allowed or blocked.\nIt is `,_jsx(_components.code,{children:`IGNORED`}),` when the domain was added with\n`,_jsx(_components.a,{href:`/sdk/threat-detector/instance-methods/ignore`,children:_jsx(_components.code,{children:`ignore()`})}),`, for example\nafter a user chose to continue at their own risk.`]})}),_jsxs(ParamField,{body:`redirectUrl`,type:`string`,id:`param-redirect-url`,children:[_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`redirectUrl`}),` property specifies where to redirect the user when the\ndetector detects a threat. This property will only be present if the\n`,_jsx(_components.code,{children:`status`}),` property is set to `,_jsx(_components.code,{children:`BLOCKED`}),`.`]}),_jsxs(_components.p,{children:[`By default, the detector returns the ChainPatrol warning page,\n`,_jsx(_components.code,{children:`https://app.chainpatrol.io/preview`}),`, with the checked URL in the `,_jsx(_components.code,{children:`target`}),`\nand `,_jsx(_components.code,{children:`originUrl`}),` query parameters. You can override this by passing your\nown `,_jsx(_components.code,{children:`redirectUrl`}),` when creating the `,_jsx(_components.code,{children:`ThreatDetector`}),`.`]})]})]})}),`\n`,_jsx(Heading,{level:`3`,id:`failure`,children:`Failure`}),`\n`,_jsx(_components.p,{children:`However, if the check was unsuccessful, the object will contain the following:`}),`\n`,_jsx(ParamField,{body:`result`,type:`object`,required:true,id:`param-result-1`,children:_jsxs(Expandable,{title:`properties`,defaultOpen:true,children:[_jsx(ParamField,{body:`ok`,type:`false`,required:true,id:`param-ok-1`,children:_jsxs(_components.p,{children:[`This property will be `,_jsx(_components.code,{children:`false`}),` if the check was unsuccessful.`]})}),_jsx(ParamField,{body:`url`,type:`string`,id:`param-url-2`,children:_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`url`}),` property is the URL that was checked.`]})}),_jsx(ParamField,{body:`error`,type:`string`,id:`param-error`,children:_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`error`}),` property will contain a human-readable error message.`]})})]})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"url()","description":"Check whether a URL is a phishing or scam site with ThreatDetector.url(), returning an ALLOWED, BLOCKED, UNKNOWN or IGNORED status plus an optional redirectUrl.","href":"/sdk/threat-detector/instance-methods/url"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Example","slug":"example","depth":2,"children":[]},{"title":"Parameters","slug":"parameters","depth":2,"children":[]},{"title":"Return Value","slug":"return-value","depth":2,"children":[{"title":"Success","slug":"success","depth":3,"children":[]},{"title":"Failure","slug":"failure","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":[],"subdomain":"chainpatrol","siteName":"ChainPatrol","title":"url() - ChainPatrol","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-07T17:56:16.006Z","originalFileLocation":"sdk/threat-detector/instance-methods/url.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Check whether a URL is a phishing or scam site with ThreatDetector.url(), returning an ALLOWED, BLOCKED, UNKNOWN or IGNORED status plus an optional redirectUrl.\">\u003cmeta data-mint-head name=\"application-name\" content=\"ChainPatrol\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/chainpatrol/NioFQGDQy3PBOTVO/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/chainpatrol/NioFQGDQy3PBOTVO/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/chainpatrol/NioFQGDQy3PBOTVO/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/chainpatrol/NioFQGDQy3PBOTVO/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/chainpatrol/NioFQGDQy3PBOTVO/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/chainpatrol/NioFQGDQy3PBOTVO/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/chainpatrol/NioFQGDQy3PBOTVO/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/chainpatrol/NioFQGDQy3PBOTVO/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/chainpatrol/NioFQGDQy3PBOTVO/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"url() - ChainPatrol\">\u003cmeta data-mint-head property=\"og:description\" content=\"Check whether a URL is a phishing or scam site with ThreatDetector.url(), returning an ALLOWED, BLOCKED, UNKNOWN or IGNORED status plus an optional redirectUrl.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"ChainPatrol\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://chainpatrol.com/docs/sdk/threat-detector/instance-methods/url\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://chainpatrol.mintlify.site/docs/_mintlify/api/og/v2?division=Instance+methods\u0026amp;title=url%28%29\u0026amp;description=Check+whether+a+URL+is+a+phishing+or+scam+site+with+ThreatDetector.url%28%29%2C+returning+an+ALLOWED%2C+BLOCKED%2C+UNKNOWN+or+IGNORED+status+plus+an+optional+redirectUrl.\u0026amp;theme=1a8d7dd79d865cbc4c2f5879\u0026amp;signature=3091db88c49c83b294623b4de13028f669336666972c2bd8ad94a78accde8108\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"url() - ChainPatrol\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Check whether a URL is a phishing or scam site with ThreatDetector.url(), returning an ALLOWED, BLOCKED, UNKNOWN or IGNORED status plus an optional redirectUrl.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://chainpatrol.mintlify.site/docs/_mintlify/api/og/v2?division=Instance+methods\u0026amp;title=url%28%29\u0026amp;description=Check+whether+a+URL+is+a+phishing+or+scam+site+with+ThreatDetector.url%28%29%2C+returning+an+ALLOWED%2C+BLOCKED%2C+UNKNOWN+or+IGNORED+status+plus+an+optional+redirectUrl.\u0026amp;theme=1a8d7dd79d865cbc4c2f5879\u0026amp;signature=3091db88c49c83b294623b4de13028f669336666972c2bd8ad94a78accde8108\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/chainpatrol/NioFQGDQy3PBOTVO/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"ChainPatrol\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#6622DC\">\u003clink data-mint-head rel=\"canonical\" href=\"https://chainpatrol.com/docs/sdk/threat-detector/instance-methods/url\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/sdk/threat-detector/instance-methods/url.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://chainpatrol.com/#organization\",\"name\":\"ChainPatrol\",\"url\":\"https://chainpatrol.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/chainpatrol/R_CITzEDbsciFTsn/logo/light.svg?fit=max\u0026auto=format\u0026n=R_CITzEDbsciFTsn\u0026q=85\u0026s=8ca4a8411113008ec8f9a57dec249989\"}},{\"@type\":\"WebSite\",\"@id\":\"https://chainpatrol.com/docs#website\",\"name\":\"ChainPatrol\",\"url\":\"https://chainpatrol.com/docs\",\"publisher\":{\"@id\":\"https://chainpatrol.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://chainpatrol.com/docs/sdk/threat-detector/instance-methods/url#webpage\",\"url\":\"https://chainpatrol.com/docs/sdk/threat-detector/instance-methods/url\",\"name\":\"url()\",\"description\":\"Check whether a URL is a phishing or scam site with ThreatDetector.url(), returning an ALLOWED, BLOCKED, UNKNOWN or IGNORED status plus an optional redirectUrl.\",\"dateModified\":\"2026-11-07T17:56:16.006Z\",\"isPartOf\":{\"@id\":\"https://chainpatrol.com/docs#website\"},\"breadcrumb\":{\"@id\":\"https://chainpatrol.com/docs/sdk/threat-detector/instance-methods/url#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://chainpatrol.com/docs/sdk/threat-detector/instance-methods/url#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"API Reference\",\"item\":\"https://chainpatrol.com/docs/sdk/threat-detector/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ThreatDetector\",\"item\":\"https://chainpatrol.com/docs/sdk/threat-detector/overview\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"url()\",\"item\":\"https://chainpatrol.com/docs/sdk/threat-detector/instance-methods/url\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://chainpatrol.com/docs/sdk/threat-detector/instance-methods/url#article\",\"headline\":\"url()\",\"name\":\"url()\",\"description\":\"Check whether a URL is a phishing or scam site with ThreatDetector.url(), returning an ALLOWED, BLOCKED, UNKNOWN or IGNORED status plus an optional redirectUrl.\",\"url\":\"https://chainpatrol.com/docs/sdk/threat-detector/instance-methods/url\",\"mainEntityOfPage\":{\"@id\":\"https://chainpatrol.com/docs/sdk/threat-detector/instance-methods/url#webpage\"},\"dateModified\":\"2026-11-07T17:56:16.006Z\",\"publisher\":{\"@id\":\"https://chainpatrol.com/#organization\"},\"isPartOf\":{\"@id\":\"https://chainpatrol.com/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"ChainPatrol\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"ChainPatrol","nav":{"global":null,"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/getting-started/what-we-do/introduction"}]},{"tab":"Integrations","pages":[{"title":"Integrations","href":"/integration/discord"}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/external-api/overview"}]},{"tab":"CLI","pages":[{"title":"CLI","href":"/cli/overview"}]},{"tab":"JavaScript SDK","groups":[{"group":"@chainpatrol/sdk","pages":[{"title":"ChainPatrol JavaScript SDK Overview","href":"/sdk/overview"},{"title":"ChainPatrol SDK Quickstart","href":"/sdk/quickstart"}]},{"group":"API Reference","pages":[{"group":"ThreatDetector","pages":[{"title":"ThreatDetector Class Overview","href":"/sdk/threat-detector/overview"},{"title":"ThreatDetector Constructor","description":"Instantiate a new ThreatDetector with local or cloud mode, an API key, storage adapter, proxy URL, and custom redirect URL for scam URL detection.","href":"/sdk/threat-detector/constructor"},{"group":"Instance methods","pages":[{"title":"url()","href":"/sdk/threat-detector/instance-methods/url"},{"title":"allow()","description":"Add a URL or domain to the ThreatDetector local allowlist so subsequent url() checks return an ALLOWED status without calling the ChainPatrol API.","href":"/sdk/threat-detector/instance-methods/allow"},{"title":"block()","href":"/sdk/threat-detector/instance-methods/block"},{"title":"ignore()","href":"/sdk/threat-detector/instance-methods/ignore"}]}]},{"group":"Storage","pages":[{"title":"Storage Adapters for ThreatDetector Caching","href":"/sdk/storage/overview"},{"title":"Browser","href":"/sdk/storage/browser"},{"title":"Extension","href":"/sdk/storage/extension"},{"title":"Memory","href":"/sdk/storage/memory"}]},{"group":"Relay","pages":[{"title":"Relay Class for Warning-Page Events","href":"/sdk/relay/overview"},{"group":"Static methods","pages":[{"title":"send()","href":"/sdk/relay/static-methods/send"},{"title":"run()","href":"/sdk/relay/static-methods/run"},{"title":"on()","href":"/sdk/relay/static-methods/on"}]}]},{"group":"ChainPatrolClient","pages":[{"title":"ChainPatrolClient Overview","href":"/sdk/chainpatrol-client/overview"},{"title":"ChainPatrolClient Constructor","href":"/sdk/chainpatrol-client/constructor"},{"group":"Instance methods","pages":[{"title":"asset.check","href":"/sdk/chainpatrol-client/instance-methods/asset-check"},{"title":"asset.list","href":"/sdk/chainpatrol-client/instance-methods/asset-list"},{"title":"asset.submit","href":"/sdk/chainpatrol-client/instance-methods/asset-submit"},{"title":"report.create","href":"/sdk/chainpatrol-client/instance-methods/report-create"}]}]}]}]},{"tab":"Glossary","pages":[{"title":"Glossary","href":"/glossary/overview"}]}]},"basePath":"","title":"url() - ChainPatrol","buildId":"dpl_BSPUBxEoKhhK7HzXVDPxdPvWx4xc","deploymentId":"dpl_BSPUBxEoKhhK7HzXVDPxdPvWx4xc","dynamics":[],"chunks":[]}