{"id":7049,"date":"2024-12-05T13:42:58","date_gmt":"2024-12-05T05:42:58","guid":{"rendered":"https:\/\/www.cloudbypass.com\/tutorial\/?p=7049"},"modified":"2024-12-05T13:42:58","modified_gmt":"2024-12-05T05:42:58","slug":"%e7%88%ac%e8%99%ab%e5%b7%a5%e7%a8%8b%e5%b8%88%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8%e7%a9%bf%e4%ba%91api%e6%9e%84%e5%bb%ba%e9%ab%98%e6%95%88%e7%9a%84%e7%88%ac%e8%99%ab%e7%b3%bb%e7%bb%9f%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/www.cloudbypass.com\/tutorial\/7049.html","title":{"rendered":"\u722c\u866b\u5de5\u7a0b\u5e08\u5982\u4f55\u4f7f\u7528\u7a7f\u4e91API\u6784\u5efa\u9ad8\u6548\u7684\u722c\u866b\u7cfb\u7edf\uff1f"},"content":{"rendered":"\n<p>\u5728\u6570\u636e\u91c7\u96c6\u7684\u4e16\u754c\u91cc\uff0c\u722c\u866b\u5de5\u7a0b\u5e08\u4eec\u6bcf\u5929\u90fd\u5728\u4e0e\u5404\u79cd\u53cd\u722c\u866b\u673a\u5236\u6597\u667a\u6597\u52c7\u3002Cloudflare\u7684\u53cd\u722c5\u79d2\u76fe\u548cTurnstile CAPTCHA\u9a8c\u8bc1\uff0c\u65e0\u7591\u662f\u6211\u4eec\u9762\u4e34\u7684\u6700\u5927\u6311\u6218\u4e4b\u4e00\u3002\u7136\u800c\uff0c\u7a7f\u4e91API\u7684\u51fa\u73b0\uff0c\u5982\u540c\u4e00\u7f15\u66d9\u5149\uff0c\u7167\u4eae\u4e86\u6211\u4eec\u524d\u884c\u7684\u9053\u8def\u3002\u5b83\u4e0d\u4ec5\u5e2e\u52a9\u6211\u4eec\u7ed5\u8fc7\u4e86\u8fd9\u4e9b\u590d\u6742\u7684\u9632\u62a4\u673a\u5236\uff0c\u8fd8\u63d0\u4f9b\u4e86\u9ad8\u6548\u7684HTTP API\u548c\u4e00\u7ad9\u5f0f\u5168\u7403\u9ad8\u901fS5\u52a8\u6001IP\u4ee3\u7406\uff0c\u4f7f\u6211\u4eec\u7684\u722c\u866b\u7cfb\u7edf\u66f4\u52a0\u5f3a\u5927\u548c\u9ad8\u6548\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u521d\u8bc6\u7a7f\u4e91API<\/h4>\n\n\n\n<p>\u8fd8\u8bb0\u5f97\u90a3\u4e2a\u5bd2\u51b7\u7684\u51ac\u591c\uff0c\u6211\u5750\u5728\u7535\u8111\u524d\uff0c\u76ef\u7740\u5c4f\u5e55\u4e0a\u7684\u9519\u8bef\u65e5\u5fd7\uff0c\u5fc3\u60c5\u6cae\u4e27\u3002\u65e0\u8bba\u6211\u5982\u4f55\u8c03\u6574\u4ee3\u7801\uff0cCloudflare\u7684\u53cd\u722c5\u79d2\u76fe\u603b\u662f\u8ba9\u6211\u7684\u722c\u866b\u65e0\u529f\u800c\u8fd4\u3002\u5c31\u5728\u6211\u51e0\u4e4e\u8981\u653e\u5f03\u7684\u65f6\u5019\uff0c\u4e00\u4f4d\u540c\u4e8b\u5411\u6211\u63a8\u8350\u4e86\u7a7f\u4e91API\u3002\u6211\u6000\u7740\u8bd5\u8bd5\u770b\u7684\u5fc3\u6001\uff0c\u5f00\u59cb\u4e86\u6211\u7684\u63a2\u7d22\u4e4b\u65c5\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"864\" src=\"https:\/\/www.cloudbypass.com\/tutorial\/wp-content\/uploads\/2024\/11\/1-1024x864.png\" alt=\"\" class=\"wp-image-6920\" title=\"\" srcset=\"https:\/\/www.cloudbypass.com\/tutorial\/wp-content\/uploads\/2024\/11\/1-1024x864.png 1024w, https:\/\/www.cloudbypass.com\/tutorial\/wp-content\/uploads\/2024\/11\/1-300x253.png 300w, https:\/\/www.cloudbypass.com\/tutorial\/wp-content\/uploads\/2024\/11\/1-768x648.png 768w, https:\/\/www.cloudbypass.com\/tutorial\/wp-content\/uploads\/2024\/11\/1.png 1276w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">\u8bf7\u6c42\u5934\u8981\u52a0\u914d\u7f6ex-cb-origin\u3001x-cb-referer<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"672\" height=\"870\" src=\"https:\/\/www.cloudbypass.com\/tutorial\/wp-content\/uploads\/2024\/11\/2.png\" alt=\"\" class=\"wp-image-6921\" title=\"\" srcset=\"https:\/\/www.cloudbypass.com\/tutorial\/wp-content\/uploads\/2024\/11\/2.png 672w, https:\/\/www.cloudbypass.com\/tutorial\/wp-content\/uploads\/2024\/11\/2-232x300.png 232w\" sizes=\"auto, (max-width: 672px) 100vw, 672px\" \/><figcaption class=\"wp-element-caption\">\u5982\u7528\u7a7f\u4e91\u4ee3\u7406\uff0c\u63d0\u53d6IP\u65f6\u8bbe\u7f6e10\u5206\u949f\u65f6\u6548<\/figcaption><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">\u7ed5\u8fc7Cloudflare\u53cd\u722c5\u79d2\u76fe<\/h4>\n\n\n\n<p>\u7a7f\u4e91API\u7684\u7b2c\u4e00\u4e2a\u4eae\u70b9\u5c31\u662f\u5b83\u80fd\u591f\u8f7b\u677e<a href=\"https:\/\/www.cloudbypass.com\/\" data-type=\"link\" data-id=\"https:\/\/www.cloudbypass.com\/\">\u7ed5\u8fc7Cloudflare<\/a>\u7684\u53cd\u722c5\u79d2\u76fe\u3002\u8fd9\u4e2a\u529f\u80fd\u8ba9\u6211\u5982\u83b7\u81f3\u5b9d\u3002\u901a\u8fc7\u7b80\u5355\u7684API\u8c03\u7528\uff0c\u6211\u53ef\u4ee5\u76f4\u63a5\u83b7\u53d6\u76ee\u6807\u7f51\u7ad9\u7684\u5185\u5bb9\uff0c\u800c\u4e0d\u518d\u9700\u8981\u62c5\u5fc3\u88ab\u62e6\u622a\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import requests\n\nurl = \"https:\/\/api.chuanyun.com\/cloudflare\"\nparams = {\n    \"target_url\": \"https:\/\/example.com\",\n    \"api_key\": \"your_api_key\"\n}\n\nresponse = requests.get(url, params=params)\nprint(response.text)<\/code><\/pre>\n\n\n\n<p>\u8fd9\u6bb5\u4ee3\u7801\u770b\u4f3c\u7b80\u5355\uff0c\u4f46\u5b83\u80cc\u540e\u7684\u6280\u672f\u5374\u975e\u5e38\u590d\u6742\u3002\u7a7f\u4e91API\u901a\u8fc7\u6a21\u62df\u771f\u5b9e\u7528\u6237\u7684\u884c\u4e3a\uff0c\u6210\u529f\u7ed5\u8fc7\u4e86Cloudflare\u7684\u9632\u62a4\u673a\u5236\uff0c\u8ba9\u6211\u7684\u722c\u866b\u7cfb\u7edf\u5f97\u4ee5\u987a\u5229\u8fd0\u884c\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u7a81\u7834Turnstile CAPTCHA\u9a8c\u8bc1<\/h4>\n\n\n\n<p>Turnstile CAPTCHA\u9a8c\u8bc1\u662f\u53e6\u4e00\u4e2a\u8ba9\u4eba\u5934\u75bc\u7684\u95ee\u9898\u3002\u7136\u800c\uff0c\u7a7f\u4e91API\u518d\u6b21\u5c55\u793a\u4e86\u5b83\u7684\u5f3a\u5927\u529f\u80fd\u3002\u901a\u8fc7\u5185\u7f6e\u7684CAPTCHA\u89e3\u51b3\u65b9\u6848\uff0c\u6211\u53ef\u4ee5\u8f7b\u677e\u7a81\u7834\u8fd9\u4e00\u5c42\u9632\u62a4\uff0c\u65e0\u963b\u788d\u5730\u6ce8\u518c\u548c\u767b\u5f55\u76ee\u6807\u7f51\u7ad9\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import requests\n\nurl = \"https:\/\/api.chuanyun.com\/captcha\"\nparams = {\n    \"captcha_url\": \"https:\/\/example.com\/captcha\",\n    \"api_key\": \"your_api_key\"\n}\n\nresponse = requests.get(url, params=params)\nprint(response.text)<\/code><\/pre>\n\n\n\n<p>\u6bcf\u6b21\u770b\u5230\u722c\u866b\u6210\u529f\u7ed5\u8fc7CAPTCHA\u9a8c\u8bc1\uff0c\u6211\u7684\u5fc3\u60c5\u90fd\u4f1a\u53d8\u5f97\u683c\u5916\u6109\u60a6\u3002\u8fd9\u4e0d\u4ec5\u662f\u6280\u672f\u7684\u80dc\u5229\uff0c\u66f4\u662f\u6211\u4eec\u6570\u636e\u91c7\u96c6\u5de5\u4f5c\u7684\u4e00\u5927\u7a81\u7834\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u9ad8\u901fS5\u52a8\u6001IP\u4ee3\u7406<\/h4>\n\n\n\n<p>\u7a7f\u4e91API\u8fd8\u63d0\u4f9b\u4e86\u4e00\u7ad9\u5f0f\u5168\u7403\u9ad8\u901fS5\u52a8\u6001IP\u4ee3\u7406\uff0c\u8fd9\u5bf9\u4e8e\u6211\u4eec\u7684\u722c\u866b\u7cfb\u7edf\u6765\u8bf4\uff0c\u65e0\u7591\u662f\u9526\u4e0a\u6dfb\u82b1\u3002\u901a\u8fc7\u4f7f\u7528\u8fd9\u4e9b\u9ad8\u901fIP\u4ee3\u7406\uff0c\u6211\u4eec\u53ef\u4ee5\u5927\u5927\u63d0\u9ad8\u6570\u636e\u91c7\u96c6\u7684\u6548\u7387\u548c\u6210\u529f\u7387\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import requests\n\nurl = \"https:\/\/api.chuanyun.com\/proxy\"\nparams = {\n    \"api_key\": \"your_api_key\"\n}\n\nresponse = requests.get(url, params=params)\nproxy = response.json()&#91;\"proxy\"]\n\n# \u4f7f\u7528\u4ee3\u7406\u8bbf\u95ee\u76ee\u6807\u7f51\u7ad9\ntarget_url = \"https:\/\/example.com\"\nproxies = {\n    \"http\": proxy,\n    \"https\": proxy\n}\n\nresponse = requests.get(target_url, proxies=proxies)\nprint(response.text)<\/code><\/pre>\n\n\n\n<p>\u6bcf\u6b21\u770b\u5230\u6570\u636e\u91c7\u96c6\u7684\u901f\u5ea6\u548c\u6210\u529f\u7387\u663e\u8457\u63d0\u9ad8\uff0c\u6211\u7684\u5fc3\u60c5\u90fd\u4f1a\u53d8\u5f97\u683c\u5916\u6fc0\u52a8\u3002\u8fd9\u4e0d\u4ec5\u662f\u6280\u672f\u7684\u8fdb\u6b65\uff0c\u66f4\u662f\u6211\u4eec\u5de5\u4f5c\u6548\u7387\u7684\u63d0\u5347\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u8bbe\u7f6e\u6d4f\u89c8\u5668\u6307\u7eb9\u7279\u5f81<\/h4>\n\n\n\n<p>\u4e3a\u4e86\u8fdb\u4e00\u6b65\u63d0\u9ad8\u722c\u866b\u7684\u9690\u853d\u6027\uff0c\u7a7f\u4e91API\u8fd8\u63d0\u4f9b\u4e86\u8bbe\u7f6eReferer\u3001\u6d4f\u89c8\u5668UA\u548cheadless\u72b6\u6001\u7b49\u5404\u6d4f\u89c8\u5668\u6307\u7eb9\u8bbe\u5907\u7279\u5f81\u7684\u529f\u80fd\u3002\u8fd9\u4e9b\u529f\u80fd\u8ba9\u6211\u7684\u722c\u866b\u7cfb\u7edf\u66f4\u52a0\u96be\u4ee5\u88ab\u53d1\u73b0\u548c\u62e6\u622a\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import requests\n\nurl = \"https:\/\/api.chuanyun.com\/browser\"\nparams = {\n    \"target_url\": \"https:\/\/example.com\",\n    \"api_key\": \"your_api_key\",\n    \"referer\": \"https:\/\/referer.com\",\n    \"ua\": \"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/58.0.3029.110 Safari\/537.3\"\n}\n\nresponse = requests.get(url, params=params)\nprint(response.text)<\/code><\/pre>\n\n\n\n<p>\u6bcf\u6b21\u770b\u5230\u722c\u866b\u6210\u529f\u6a21\u62df\u771f\u5b9e\u7528\u6237\u7684\u884c\u4e3a\uff0c\u6211\u7684\u5fc3\u60c5\u90fd\u4f1a\u53d8\u5f97\u683c\u5916\u6ee1\u8db3\u3002\u8fd9\u4e0d\u4ec5\u662f\u6280\u672f\u7684\u6210\u529f\uff0c\u66f4\u662f\u6211\u4eec\u5de5\u4f5c\u7684\u4e00\u5927\u8fdb\u6b65\u3002<\/p>\n\n\n\n<p>\u7a7f\u4e91API\u7684\u51fa\u73b0\uff0c\u65e0\u7591\u662f\u6211\u4eec\u722c\u866b\u5de5\u7a0b\u5e08\u7684\u4e00\u5927\u798f\u97f3\u3002\u5b83\u4e0d\u4ec5\u5e2e\u52a9\u6211\u4eec\u7ed5\u8fc7\u4e86Cloudflare\u7684\u53cd\u722c5\u79d2\u76fe\u548cTurnstile CAPTCHA\u9a8c\u8bc1\uff0c\u8fd8\u63d0\u4f9b\u4e86\u9ad8\u6548\u7684HTTP API\u548c\u4e00\u7ad9\u5f0f\u5168\u7403\u9ad8\u901fS5\u52a8\u6001IP\u4ee3\u7406\uff0c\u4f7f\u6211\u4eec\u7684\u722c\u866b\u7cfb\u7edf\u66f4\u52a0\u5f3a\u5927\u548c\u9ad8\u6548\u3002\u6bcf\u6b21\u770b\u5230\u722c\u866b\u6210\u529f\u91c7\u96c6\u5230\u6570\u636e\uff0c\u6211\u7684\u5fc3\u60c5\u90fd\u4f1a\u53d8\u5f97\u683c\u5916\u6109\u60a6\u3002\u8fd9\u4e0d\u4ec5\u662f\u6280\u672f\u7684\u80dc\u5229\uff0c\u66f4\u662f\u6211\u4eec\u6570\u636e\u91c7\u96c6\u5de5\u4f5c\u7684\u4e00\u5927\u7a81\u7834\u3002<\/p>\n\n\n\n<p>\u5728\u8fd9\u4e2a\u6570\u636e\u91c7\u96c6\u7684\u4e16\u754c\u91cc\uff0c\u6211\u4eec\u6bcf\u5929\u90fd\u5728\u4e0e\u5404\u79cd\u53cd\u722c\u866b\u673a\u5236\u6597\u667a\u6597\u52c7\u3002\u7136\u800c\uff0c\u7a7f\u4e91API\u7684\u51fa\u73b0\uff0c\u5982\u540c\u4e00\u7f15\u66d9\u5149\uff0c\u7167\u4eae\u4e86\u6211\u4eec\u524d\u884c\u7684\u9053\u8def\u3002\u5b83\u4e0d\u4ec5\u5e2e\u52a9\u6211\u4eec\u7ed5\u8fc7\u4e86\u8fd9\u4e9b\u590d\u6742\u7684\u9632\u62a4\u673a\u5236\uff0c\u8fd8\u63d0\u4f9b\u4e86\u9ad8\u6548\u7684HTTP API\u548c\u4e00\u7ad9\u5f0f\u5168\u7403\u9ad8\u901fS5\u52a8\u6001IP\u4ee3\u7406\uff0c\u4f7f\u6211\u4eec\u7684\u722c\u866b\u7cfb\u7edf\u66f4\u52a0\u5f3a\u5927\u548c\u9ad8\u6548\u3002\u6bcf\u6b21\u770b\u5230\u722c\u866b\u6210\u529f\u91c7\u96c6\u5230\u6570\u636e\uff0c\u6211\u7684\u5fc3\u60c5\u90fd\u4f1a\u53d8\u5f97\u683c\u5916\u6109\u60a6\u3002\u8fd9\u4e0d\u4ec5\u662f\u6280\u672f\u7684\u80dc\u5229\uff0c\u66f4\u662f\u6211\u4eec\u6570\u636e\u91c7\u96c6\u5de5\u4f5c\u7684\u4e00\u5927\u7a81\u7834\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u6570\u636e\u91c7\u96c6\u7684\u4e16\u754c\u91cc\uff0c\u722c\u866b\u5de5\u7a0b\u5e08\u4eec\u6bcf\u5929\u90fd\u5728\u4e0e\u5404\u79cd\u53cd\u722c\u866b\u673a\u5236\u6597\u667a\u6597\u52c7\u3002Cloudflare\u7684\u53cd\u722c5\u79d2\u76fe\u548cTurns&#8230;<\/p>\n<p class=\"more-link-wrap\"><a href=\"https:\/\/www.cloudbypass.com\/tutorial\/7049.html\" class=\"more-link\">Read More<span class=\"screen-reader-text\"> &ldquo;\u722c\u866b\u5de5\u7a0b\u5e08\u5982\u4f55\u4f7f\u7528\u7a7f\u4e91API\u6784\u5efa\u9ad8\u6548\u7684\u722c\u866b\u7cfb\u7edf\uff1f&rdquo;<\/span> &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":3625,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[],"class_list":["post-7049","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-skip-cloudflare-verification"],"_links":{"self":[{"href":"https:\/\/www.cloudbypass.com\/tutorial\/wp-json\/wp\/v2\/posts\/7049","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cloudbypass.com\/tutorial\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cloudbypass.com\/tutorial\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cloudbypass.com\/tutorial\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cloudbypass.com\/tutorial\/wp-json\/wp\/v2\/comments?post=7049"}],"version-history":[{"count":1,"href":"https:\/\/www.cloudbypass.com\/tutorial\/wp-json\/wp\/v2\/posts\/7049\/revisions"}],"predecessor-version":[{"id":7050,"href":"https:\/\/www.cloudbypass.com\/tutorial\/wp-json\/wp\/v2\/posts\/7049\/revisions\/7050"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.cloudbypass.com\/tutorial\/wp-json\/wp\/v2\/media\/3625"}],"wp:attachment":[{"href":"https:\/\/www.cloudbypass.com\/tutorial\/wp-json\/wp\/v2\/media?parent=7049"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cloudbypass.com\/tutorial\/wp-json\/wp\/v2\/categories?post=7049"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cloudbypass.com\/tutorial\/wp-json\/wp\/v2\/tags?post=7049"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}