|
| 1 | +imagetyperzapi - Imagetyperz API wrapper |
| 2 | +========================================= |
| 3 | +imagetyperzapi is a super easy to use bypass captcha API wrapper for imagetyperz.com captcha service |
| 4 | + |
| 5 | +## Installation |
| 6 | + Install-Package imagetyperzapi |
| 7 | + |
| 8 | +or |
| 9 | + |
| 10 | + git clone https://github.com/imagetyperz-api/imagetyperz-api-csharp |
| 11 | + |
| 12 | +## How to use? |
| 13 | + |
| 14 | +Simply import the library, set the auth details and start using the captcha service: |
| 15 | + |
| 16 | +``` csharp |
| 17 | +using imagetyperzapi; |
| 18 | +``` |
| 19 | +Set access_token or username and password (legacy) for authentication |
| 20 | + |
| 21 | +``` csharp |
| 22 | +string access_key = "your_access_key"; |
| 23 | +ImagetyperzAPI i = new ImagetyperzAPI(access_key); |
| 24 | +``` |
| 25 | +legacy authentication, will get deprecated at some point |
| 26 | +```csharp |
| 27 | +i.set_user_and_password("your_username", "your_password"); |
| 28 | +``` |
| 29 | +Once you've set your authentication details, you can start using the API |
| 30 | + |
| 31 | +**Get balance** |
| 32 | + |
| 33 | +``` csharp |
| 34 | +string balance = i.account_balance(); |
| 35 | +Console.WriteLine(string.Format("Balance: {0}", balance)); |
| 36 | +``` |
| 37 | + |
| 38 | +**Submit image captcha** |
| 39 | + |
| 40 | +``` csharp |
| 41 | +var captcha_text = i.solve_captcha("captcha.jpg"); |
| 42 | +Console.WriteLine(string.Format("Got response: {0}", captcha_text)); |
| 43 | +``` |
| 44 | +Takes a 2nd argument, **case_sensitive** which is a bool |
| 45 | +``` csharp |
| 46 | +// tell our server this is caseSensitive, false by default |
| 47 | +var captcha_text = i.solve_captcha("captcha.jpg", true); |
| 48 | +``` |
| 49 | + |
| 50 | +**Works with both files and URLs** |
| 51 | +``` csharp |
| 52 | +var captcha_text = i.solve_captcha("http://abc.com/captcha.jpg"); |
| 53 | +``` |
| 54 | +**OBS:** URL instead of image file path works when you're authenticated with access_key. For those that are still using username & password, retrieve your access_key from imagetyperz.com |
| 55 | + |
| 56 | +**Submit recaptcha details** |
| 57 | + |
| 58 | +For recaptcha submission there are two things that are required. |
| 59 | +- page_url |
| 60 | +- site_key |
| 61 | +``` csharp |
| 62 | +string page_url = "your_page_url_here"; |
| 63 | +string sitekey = "your_site_key_here"; |
| 64 | +// get captcha_id, we'll use this later |
| 65 | +string captcha_id = i.submit_recaptcha(page_url, sitekey); |
| 66 | +``` |
| 67 | +This method returns a captchaID. This ID will be used next, to retrieve the g-response, once workers have |
| 68 | +completed the captcha. This takes somewhere between 10-80 seconds. |
| 69 | + |
| 70 | +**Retrieve captcha response** |
| 71 | + |
| 72 | +Once you have the captchaID, you check for it's progress, and later on retrieve the gresponse. |
| 73 | + |
| 74 | +The ***in_progress(captcha_id)*** method will tell you if captcha is still being decoded by workers. |
| 75 | +Once it's no longer in progress, you can retrieve the gresponse with ***retrieve_recaptcha(captcha_id)*** |
| 76 | + |
| 77 | +``` csharp |
| 78 | +Console.WriteLine("Waiting for recaptcha to be solved ..."); |
| 79 | +while (i.in_progress(captcha_id)) // check if it's still being decoded |
| 80 | +{ System.Threading.Thread.Sleep(10000); } // sleep for 10 seconds |
| 81 | +string recaptcha_response = i.retrieve_captcha(captcha_id); // get the response |
| 82 | +Console.WriteLine(string.Format("Recaptcha response: {0}", recaptcha_response)); |
| 83 | +``` |
| 84 | + |
| 85 | +## Other methods/variables |
| 86 | + |
| 87 | +**Affiliate id** |
| 88 | + |
| 89 | +The constructor accepts a 2nd parameter, as the affiliate id. |
| 90 | +``` csharp |
| 91 | +ImagetypersAPI i = new ImagetypersAPI(access_token, 123); |
| 92 | +``` |
| 93 | + |
| 94 | +**Requests timeout** |
| 95 | + |
| 96 | +You can set the timeout for the requests using the **set_timeout(seconds)** method |
| 97 | +``` csharp |
| 98 | +i.set_timeout(10); |
| 99 | +``` |
| 100 | + |
| 101 | +**Submit recaptcha with proxy** |
| 102 | + |
| 103 | +When a proxy is submitted with the recaptcha details, the workers will complete the captcha using |
| 104 | +the provided proxy/IP. |
| 105 | + |
| 106 | +``` csharp |
| 107 | +i.submit_recaptcha(page_url, sitekey, "127.0.0.1:1234"); |
| 108 | +``` |
| 109 | +Proxy with authentication is also supported |
| 110 | +``` csharp |
| 111 | +i.submit_recaptcha(page_url, sitekey, "127.0.0.1:1234:user:pass"); |
| 112 | +``` |
| 113 | + |
| 114 | +**Set captcha bad** |
| 115 | + |
| 116 | +When a captcha was solved wrong by our workers, you can notify the server with it's ID, |
| 117 | +so we know something went wrong |
| 118 | + |
| 119 | +``` csharp |
| 120 | +i.set_captcha_bad(captcha_id); |
| 121 | +``` |
| 122 | + |
| 123 | +## Examples |
| 124 | +Compile and run the **example** project in solution |
| 125 | + |
| 126 | +## Command-line client |
| 127 | +For those that are looking for a command-line, check out the **imagetyperz-cli** project in solution |
| 128 | +It's a tool that allows you to do pretty much all the API offers, from the command-line |
| 129 | +Check it's README.md file of the cli for more details |
| 130 | + |
| 131 | +## Binary |
| 132 | +If you don't want to compile your own library, you can check the binary folder for a compiled version. |
| 133 | +**Keep in mind** that this might not be the latest version with every release |
| 134 | + |
| 135 | +## License |
| 136 | +API library is licensed under the MIT License |
| 137 | + |
| 138 | +## More information |
| 139 | +More details about the server-side API can be found [here](http://imagetyperz.com) |
| 140 | + |
| 141 | + |
| 142 | +<sup><sub>captcha, bypasscaptcha, decaptcher, decaptcha, 2captcha, deathbycaptcha, anticaptcha, |
| 143 | +bypassrecaptchav2, bypassnocaptcharecaptcha, bypassinvisiblerecaptcha, captchaservicesforrecaptchav2, |
| 144 | +recaptchav2captchasolver, googlerecaptchasolver, recaptchasolverpython, recaptchabypassscript</sup></sub> |
0 commit comments