Does anybody know if via the google api in java I can create google accounts programmatically.
-
4Sure, you just have to break their CAPTCHA. – David Apr 23 '10 at 13:43
-
3IANAL, but I suppose that would be breaking their agreement, and you probably don't want to do that. – JRL Apr 23 '10 at 13:48
-
4seriously guys. I don't want to break any CAPTCHA - which would be illegal. I just want to be able to create google accounts programmatically. – rowly Apr 23 '10 at 13:52
-
1Just consider that you could do that. What would stop cybersquatters, spammers and other not-so good guys from doing the same thing for their not-so-good purposes? – George Apr 23 '10 at 14:00
-
3you know what's annoying somebody has voted me down. can anybody explain why ? or maybe if I ask I will be voted down again – rowly Apr 23 '10 at 15:48
-
1For better or worse, you're not required to explain your downvotes; that's been discussed extensively on meta. My guess is that the downvoter smelled illegal activity. – Pops Apr 23 '10 at 16:46
-
1I'm curious, why would you like to create google accounts programatically? – OscarRyz Apr 23 '10 at 17:24
-
3@rowly Breaking captcha is FAR from illegal (it bothers me that so many people have misconceptions like yours). It's likely breaking Google's TOS, which just gives them the right to refuse to service you. Still probably a bad idea, though. – Ponkadoodle Oct 20 '13 at 01:34
-
Ask Google - if you give them money I'm pretty sure they will allow you quite a lot. – Thorbjørn Ravn Andersen Apr 23 '10 at 18:50
-
Idea: extract captcha images in a pop up and fill it out yourself.... – Polydynamical Oct 17 '20 at 20:01
11 Answers
Yes
(ish)
The Admin SDK Directory API allows you to create accounts which work with Google tools (Gmail, Calendar, etc.) but are not @gmail.com / @googlemail.com accounts.
This is used by companies to automate creation of accounts for online google tools when new users are added to networks and similar scenarios.
User management is documented here.
This replaces the provisioning API which was deprecated in 2013.

- 26,321
- 24
- 115
- 201
-
can I create google account with @ company.com and use it for Google SSO? – Bluetree Jun 11 '20 at 02:27
-
@Bluetree I believe you'd need to pay for G Suite (Previously Business Apps) but it's been a *long* time since I've tried it myselfl, so take that with a pinch of salt. – Basic Jun 11 '20 at 15:51
NO
The only possible way to do this would be to use a web automation framework. Python is great for web automation using tools such as mechanize. I've never done it in Java, but you should do a google search for java programmatic web browser
or java web automation
.
On top of that you would have to incorporate an OCR package to beat the captcha.
There is a reason that google, nor anyone else, allows the programmatic creation of accounts. Spammers would have a field day. Within days there would be no valid accounts left for any new users to use. In short, it would be a disaster.

- 3,749
- 2
- 21
- 24
-
2Last time I created a google account, I actually had to call a phone number to verify my humanity. I don't think you could automate something like that very easily. – Juliet Jul 08 '10 at 23:43
As others have pointed out, you cannot create Google consumer accounts (ie, @gmail accounts) via any sort of API. It would create a field day for Spammers. To make it difficult for Spammers, Google uses tactics such as CAPTCHAs to prevent abuse.
But, you can create Google Apps accounts via their Provisioning APIs. A Google Apps account is basically a white labeled version of Google Apps (Gmail, Calendar, Docs, etc) that is under your own domain name.
For the same Spam concerns, your Google Apps account would have to be either a Premier domain (where you pay for every account you provision) or an Educational institution (I assume some sort of verification process for that). So, since you have to pay for each account, it's not a huge risk for spammers (unless they want to pay big $$$ for each account.. very unlikely).

- 161
- 1
It depends on your definition of create account...
it is possible to create an account inside a google group, or domain. By using the code below you can create accounts for your google group/domain. For this scenario YES you CAN create a google account.
However, if you want to create a google account as in @gmail.com... I really have not found a way to do it programatically.
Here is the link of where to download the google api, and the Documentation. https://developers.google.com/google-apps/provisioning/#creating_a_user_account
Good Luck.
import sample.appsforyourdomain.AppsForYourDomainClient;
AppsForYourDomainClient client = new AppsForYourDomainClient(email, password, domain);
client.createUser(String username, String givenName, String familyName, String password)

- 2,833
- 3
- 26
- 28
MAYBE?
I am going to write an answer that has not been written so far, but which could actually break the EULA (if that's the case, can someone point out the specific paragraph of it that prevents this?).
The solution is: redirect Google's CAPTCHA to your user.
Assuming your software has a user, you could present them Google's captcha so the account is created by them, for your system, without them knowing.
Would this work for you?

- 242
- 3
- 18

- 16,941
- 11
- 79
- 125
-
Solving the captcha is only one step to the process of automated account creation. – Ponkadoodle Oct 20 '13 at 01:37
-
-
1Well I was assuming that the only interface Google has for account creation is their web interface, and so you would also have to do some web scraping and browser spoofing. – Ponkadoodle Oct 27 '13 at 21:51
-
I did some of tinkering with gmail, and there's a good bit of obfuscated javascript code that's implemented *specifically* to prevent automation. I can't tell what all of it does, but google pays attention to how long you take to fill out each form item. So even if you use something like Selenium to automate a real webbrowser, it seems like it would take a bit of extra work. – Ponkadoodle Dec 19 '13 at 01:34
-
ok, maybe one could slow down Selenium to make it appear to be a real person? hehe – knocte Dec 19 '13 at 09:12
The real answer is YES.
The fact is that we don't know (yet) how.
The proof is that an account can be created from any android device without any captcha, without a phone number and without an email.
So the secret is inside android codebase.

- 9,096
- 3
- 52
- 44
-
2Google probably allows this because it associates each account created in this way with the particular device used. They can be linked to a phone number at Google's discretion at any opportunity in the future, & even if they weren't it wouldn't matter, as a unique id is just that whether it's a phone number or device id. That said, for the cost of anonymously buying an Android device & using it only for account creation on networks not unique to yourself, you can have an anonymous Google account without providing a phone number, for as long as Google accepts accounts created in that fashion. – Jan Kyu Peblik Sep 19 '19 at 17:37
-
@JanKyuPeblik *update*: it is also possible from some countries to create a google account without phone number and from the normal web page... – Zibri Feb 14 '20 at 15:49
You can do that theoretically, but Google's account creation - like other services - uses image recognition for confirmation that you're a user (aka CAPTCHA) and you need to be able to write image recognition program that can do that.
AFAIK there's no programmatic API from Google to create accounts, since doing so would open them up to spammers/scammers/etc... which the CAPTCA was meant to prevent.
Why would you do that? I am not sure Google allows that in the first place as far as EULA.

- 126,886
- 32
- 213
- 327
YES...
Actually you can do that. You can write CUrl scripts and can use different APIs available to break the captcha. Breaking a captcha is key thing here.

- 242
- 3
- 18

- 71
- 9
-
-
1https://2captcha.com/blog/bypassing-recaptcha-v2-on-google-search by using APIs on this site you can do it. – shankar kanase May 19 '22 at 13:10
Actually, you can create if by google account you mean your own domain (those business ones using google). You can check it here
The fact that Google's account creation UI requires a CAPTCHA is your first hint that the answer is NO.

- 49,714
- 13
- 63
- 88