{"id":1391,"date":"2019-07-25T15:44:18","date_gmt":"2019-07-25T15:44:18","guid":{"rendered":"http:\/\/127.0.0.1:8086\/?p=1391"},"modified":"2019-08-06T12:07:26","modified_gmt":"2019-08-06T12:07:26","slug":"solving-recaptcha-v2-via-api","status":"publish","type":"post","link":"https:\/\/deathbycaptcha.com\/blog\/tutorials-guides\/solving-recaptcha-v2-via-api","title":{"rendered":"Solving reCaptcha v2 via API (example)"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p>If you are interested in solving reCaptcha v2, our API requires a <strong>URL<\/strong>, a <strong>Sitekey<\/strong> and optionally a <strong>proxy<\/strong>, we will guide you on how to perform the whole captcha solving process from the very beginning.<\/p>\n<p>This is the initial page, the URL which contains the reCatcha you want to solve. You already have the URL now we need to get the Sitekey.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-1395 aligncenter\" style=\"border: 1px solid #ddd; border-radius: 4px; padding: 5px;\" src=\"https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/01-recaptcha_page-245x300.png\" alt=\"\" width=\"398\" height=\"489\" srcset=\"https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/01-recaptcha_page-200x245.png 200w, https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/01-recaptcha_page-245x300.png 245w, https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/01-recaptcha_page-400x490.png 400w\" sizes=\"auto, (max-width: 398px) 100vw, 398px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>There are <strong>two ways<\/strong> to obtain the Sitekey, the first one is finding the <strong>\u201cdata-sitekey\u201d<\/strong> tag in the HTML of the page. The second one is finding the <strong>\u201ciframe\u201d<\/strong> tag. We will see how to find it both ways.<\/p>\n<p>First step is using the built-in <strong>\u201cInspect Element\u201d<\/strong> feature of your browser. Then find the <strong>\u201cdata-sitekey\u201d<\/strong> tag.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-400 wp-image-1396 aligncenter\" style=\"border: 1px solid #ddd; border-radius: 4px; padding: 5px;\" src=\"https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/02-inspect_element-400x423.png\" alt=\"\" width=\"400\" height=\"423\" srcset=\"https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/02-inspect_element-200x212.png 200w, https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/02-inspect_element-283x300.png 283w, https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/02-inspect_element-400x423.png 400w, https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/02-inspect_element.png 547w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1397 \" style=\"border: 1px solid #ddd; border-radius: 4px; padding: 5px;\" src=\"https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/03-data-sitekey_tag.png\" alt=\"\" width=\"853\" height=\"404\" srcset=\"https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/03-data-sitekey_tag-200x95.png 200w, https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/03-data-sitekey_tag-300x142.png 300w, https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/03-data-sitekey_tag-400x189.png 400w, https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/03-data-sitekey_tag-600x284.png 600w, https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/03-data-sitekey_tag-768x363.png 768w, https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/03-data-sitekey_tag-800x378.png 800w, https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/03-data-sitekey_tag.png 1004w\" sizes=\"auto, (max-width: 853px) 100vw, 853px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><em><strong>Finding the Sitekey using the \u201ciframe\u201d tag:<\/strong><\/em><br \/>\nWe will follow the same steps, this time we will search for <strong>\u201ciframe\u201d<\/strong> instead, (there could be several in one site, make sure you are accessing the one for the reCaptcha), right click on it an select <strong>\u201cEdit as HTML\u201d<\/strong> after you\u2019ve done it you will be able to extract the Sitekey from it, follow the example in the pictures.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-1398 size-full aligncenter\" style=\"border: 1px solid #ddd; border-radius: 4px; padding: 5px;\" src=\"https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/03-iframe_inspect.png\" alt=\"\" width=\"713\" height=\"497\" srcset=\"https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/03-iframe_inspect-200x139.png 200w, https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/03-iframe_inspect-300x209.png 300w, https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/03-iframe_inspect-400x279.png 400w, https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/03-iframe_inspect-600x418.png 600w, https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/03-iframe_inspect.png 713w\" sizes=\"auto, (max-width: 713px) 100vw, 713px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-600 wp-image-1400 aligncenter\" style=\"border: 1px solid #ddd; border-radius: 4px; padding: 5px;\" src=\"https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/04-edit_as_html-600x345.png\" alt=\"\" width=\"600\" height=\"345\" srcset=\"https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/04-edit_as_html-200x115.png 200w, https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/04-edit_as_html-300x172.png 300w, https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/04-edit_as_html-400x230.png 400w, https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/04-edit_as_html-600x345.png 600w, https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/04-edit_as_html-768x441.png 768w, https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/04-edit_as_html-800x460.png 800w, https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/04-edit_as_html.png 839w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Now, you\u2019ve found your Sitekey and URL, it\u2019s time to save your parameters as a <strong>JSON file<\/strong>. If you are not using a proxy you can leave \u201cproxy\u201d and \u201cproxytype\u201d parameters empty as in the example.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-1401 aligncenter\" style=\"border: 1px solid #ddd; border-radius: 4px; padding: 5px;\" src=\"https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/06-curl_params.png\" alt=\"\" width=\"762\" height=\"398\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>It\u2019s now time to make your API call; first make a <strong>POST<\/strong> request to the URL \u2018<strong>http:\/\/api.dbcapi.me\/api\/captcha<\/strong>\u2019 using your <strong>username<\/strong>, <strong>password<\/strong>, <strong>captcha type<\/strong> and recently created \u201c<em><strong>params.json<\/strong><\/em>\u201d file, finally send the request.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-1402 aligncenter\" style=\"border: 1px solid #ddd; border-radius: 4px; padding: 5px;\" src=\"https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/07-recaptcha_api_call.png\" alt=\"\" width=\"900\" height=\"380\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>You will then receive a token which you will be able to insert into the reCaptcha field using JS or any other of the methods available.<br \/>\nFor this example we will use JavaScript.<\/p>\n<p>You can copy and paste this code into the browser console: <strong>document.getElementById(&#8220;g-recaptcha-response&#8221;).innerHTML=&#8221;Response_token_DeathByCaptcha&#8221;<\/strong>;<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1403 aligncenter\" style=\"border: 1px solid #ddd; border-radius: 4px; padding: 5px;\" src=\"https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/09-field_token_js_code.png\" alt=\"\" width=\"737\" height=\"125\" srcset=\"https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/09-field_token_js_code-200x34.png 200w, https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/09-field_token_js_code-300x51.png 300w, https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/09-field_token_js_code-400x68.png 400w, https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/09-field_token_js_code-600x102.png 600w, https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/09-field_token_js_code.png 737w\" sizes=\"auto, (max-width: 737px) 100vw, 737px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Then replace the text \u2018Response_token_DeathByCaptcha\u2019 with the actual token received and press <strong>ENTER<\/strong>.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-1404 aligncenter\" style=\"border: 1px solid #ddd; border-radius: 4px; padding: 5px;\" src=\"https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/07-token_retrieved.png\" alt=\"\" width=\"379\" height=\"266\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-1406 aligncenter\" style=\"border: 1px solid #ddd; border-radius: 4px; padding: 5px;\" src=\"https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/09-field_token.png\" alt=\"\" width=\"717\" height=\"268\" \/><\/p>\n<p>Now copy this code fragment \u2018<strong>document.forms[0].submit();<\/strong>\u2019, this will submit the first form in the site which usually is the one containing the reCaptcha.<img loading=\"lazy\" decoding=\"async\" class=\"wp-image-1405 aligncenter\" src=\"https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/09-submitting_token.png\" alt=\"\" width=\"800\" height=\"373\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>If that one doesn\u2019t work you can try submitting the reCaptcha by the ID of the form that contains it.<br \/>\nEx.: <strong>document.getElementById(&#8220;recaptcha-demo-form&#8221;).submit();<\/strong><\/p>\n<p>Then just hit ENTER and the reCaptcha will be marked as solved and you will be redirected to the next page.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-1407 aligncenter\" style=\"border: 1px solid #ddd; border-radius: 4px; padding: 5px;\" src=\"https:\/\/deathbycaptcha.com\/blog\/wp-content\/uploads\/2019\/07\/10-verification_success.png\" alt=\"\" width=\"640\" height=\"355\" \/><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; If you are interested in solving reCaptcha v2, our API requires a URL, a Sitekey and optionally a proxy, we will guide you on how to perform the whole captcha solving process from the very beginning. This is the initial page, the URL which contains the reCatcha you want to solve. You already have [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[56],"tags":[],"class_list":["post-1391","post","type-post","status-publish","format-standard","hentry","category-tutorials-guides"],"_links":{"self":[{"href":"https:\/\/deathbycaptcha.com\/blog\/wp-json\/wp\/v2\/posts\/1391","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/deathbycaptcha.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/deathbycaptcha.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/deathbycaptcha.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/deathbycaptcha.com\/blog\/wp-json\/wp\/v2\/comments?post=1391"}],"version-history":[{"count":12,"href":"https:\/\/deathbycaptcha.com\/blog\/wp-json\/wp\/v2\/posts\/1391\/revisions"}],"predecessor-version":[{"id":1418,"href":"https:\/\/deathbycaptcha.com\/blog\/wp-json\/wp\/v2\/posts\/1391\/revisions\/1418"}],"wp:attachment":[{"href":"https:\/\/deathbycaptcha.com\/blog\/wp-json\/wp\/v2\/media?parent=1391"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/deathbycaptcha.com\/blog\/wp-json\/wp\/v2\/categories?post=1391"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/deathbycaptcha.com\/blog\/wp-json\/wp\/v2\/tags?post=1391"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}