Spiga

How to check if a yahoo user exits using php

by Gabi Solomon

On a recent project i had to find a way to test if a yahoo user account entered by the user is real or not. The purpose of this was to not create unnecessary load on the server for an id that wasn't real. So i went to the yahoo registration form and looked on how do they check it.

In that form the access this address if i test my id :

https://edit.yahoo.com/reg_json?PartnerName=yahoo_default&AccountID=solomongaby@yahoo.com&ApiName=ValidateFields

There were a few other get parameters but i strip them out, since they didnt seem to add any more value, and the result was the same. If the account you entered ( solomongaby@yahoo.com in this case ) is a valid one the result will be :

HTML:
  1. {
  2.   "ResultCode":"PERMANENT_FAILURE",
  3.   "SuggestedIDList": ["infostud_ro79@yahoo.com",  "infostud_ro12@yahoo.com",  "infostud_ro89@yahoo.com"], 
  4.    "SuggestedDBIDList":["infostud_ro33@rocketmail.com","infostud_ro38@ymail.com"],
  5.    "ErrorList":[{"ErrorCode":"100000","ErrorField":"AccountID"}]
  6. }

As you see the result already has the recomandation into it. If you try to run the same request for an id that doenst exist like solomongaby12382109 you would get this result:

HTML:
  1. {"ResultCode":"SUCCESS"}

Based on this i wrote a small php function :

PHP:
  1. $check = file_get_contents('https://edit.yahoo.com/reg_json?PartnerName=yahoo_default&AccountID='.$this->id_name.'@yahoo.com&ApiName=ValidateFields');
  2.         if ( strpos($check,'SUCCESS')===false ) return true;
  3.         else return false;

Hope this has helped you.
Cheers

Related Posts

  • Cin
    YES! THANK YOU! This is EXACTLY what I've been looking for! I'm writing a function to verify if a user's email address is valid for my company, and got it working using SMTP checks for pretty much everyone except Yahoo because they use a non-standard SMTP implementation. I've been wracking my brain trying to get this working and this is perfect! Thanks again!
  • The best Yahoo Invisible Detector http://www.detector-invisible.com scanner 100% accurate.
  • or http://www.faceboo.im, scan multiple ID-s in the same time
  • lelooman
    the easy way! http://www.byeloo.org!hi5 profile also displayed!i'm not a programmer!;)
  • Cin
    I can tell you're not a programmer, since that's not even close to what this script does...
  • Hi all ...

    I found more usefull to use json_decode($check); and compare parts of the array..
    Anyhow ... i don't know why, but after som time, checking if some id's are available,
    I receive an error: " file_get_contents(https://...@yahoo.com&ApiName=ValidateFields) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 999 Unable to process request at this time -- error 999 in".

    I suppose they limit the usage of this link outside of their domain.

    Is that possible ?
  • swetha
    can i have code for checking users of yahoo
  • ismail
    can i know all yahoo ids of a particular user?
  • Norman
    Hi,

    Im looking for something similar to this for hotmail and msn. Does anyone know the link to check that?

    Thanks
  • @ Tesfalem
    check if you get something from yahoo. maybe your server is blocking file_get_contents
  • Thanks for your message

    When i click check i just got a whilt page, what i want is to pass the message to the array varaible.

    Thanks
  • @ Tesfalem
    what is the problem
  • Hello

    Thanks for the code
    I was using your code and i got some problem.
    i have a form to check weather a yahoo ID exisit or not.
    here is the code i used

    $yid=$_POST['yid']; This is tha posted data from the form submited.

    if ($yid) {
    $check = file_get_contents('https://edit.yahoo.com/reg_json?PartnerName=yahoo_default&AccountID='. $yid .'@yahoo.com&ApiName=ValidateFields');
    if ( strpos($check,'SUCCESS')===false ) return true;
    else return false;
    if ($check == false) {
    $arrErrors['yid'] = 'The Yahoo ID you input doesn\'t exist.';
    }
    }

    If you have time can you help me?
    Thanks in advance

    Tesfalem
  • you can find out the url for co.uk by looking at the registration form and searching for the url in view source
  • Keshav Kuruva
    Hi,

    This is good.

    The above script is able to check whether yahoo.com user exists or not .
    But I am unable to check for a co.uk and co.in users.

    If there is any specific url I have to use apart from edit.yahoo.com for checking users with co.uk and co.in ids , that would help us a lot .

    Or else, if there is any specific way to check for {co.uk and co.in} users?

    Thanks for the help in advance,
    Keshav
  • Check out this great Yahoo invisible detector i use... has a lot of features!
  • Sonic
    Gabi Solomon ;

    Can't we found a way to do the same thing for hotmail ?
  • this is something different, not to detect the online state ;)
  • other website with you can detect status is www.yahooscan.eu also with website you cand download your buddies avatar.
  • Ulrig
    Is there any new for the hotmail project?
  • thanks you.
  • Ulrig
    Really you are perfect programmer.... I wanna be like u... If we can find a way to find it will be very nice...
    Thanks for answer....
  • @Ulrig

    I will try and see if theres a way to do the same thing for hotmail.
  • Ulrig
    This is really perfect code. But can u write " how can we check if a hotmail user exits using php " ?

    That will be really nice.
    i need just like it (https://edit.yahoo.com/reg_json?PartnerName=yahoo_default&AccountID='.$this->id_name.'@yahoo.com&ApiName=ValidateFields)

    Thanks a lot...
  • Mihai , if you want to check a yahoo id if it's whether online, offline or invisible, you can try this website: Detect Invisible. It has an option to download the avatar too.
  • sorry mihai but i dont know of a function that detects invisible users on YM.
    the only thing i know is
    http://opi.yahoo.com/online?u=solomongaby&m;=f&t;=1
    this returns 01 if user is online ... and 00 if he isn't. But this will not detect invisible users, they will show as offline.
  • Mihai
    Yes, it is quite interesting ... but you know any function or something like that, if an id is online claim that by saying, if is't hidden claim that by saying the invisible and if it is offline claim that by saying that is offline?
    Namely:
    If online / Invizibil claim that by saying it is status-and some obtiuni down, and if it is offline ... claim that by saying simply that it offline ....
    if you could just tell me one thousand and one such function ...

    I hope you anderstand my coment...because I don't know verry well english language...
  • Aandrr
blog comments powered by Disqus