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=[email protected]&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 ( [email protected] in this case ) is a valid one the result will be :

HTML:
  1. {
  2.   "ResultCode":"PERMANENT_FAILURE",
  3.   "SuggestedIDList": ["[email protected]",  "[email protected]",  "[email protected]"], 
  4.    "SuggestedDBIDList":["[email protected]","[email protected]"],
  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

  • 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...

  • http://www.gsdesign.ro/ Gabi Solomon

    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.

  • http://revealip.net/ Reveal IP

    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.

  • 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...

  • http://www.gsdesign.ro/ Gabi Solomon

    @Ulrig

    I will try and see if theres a way to do the same thing for hotmail.

  • 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....

  • http://www.gsdesign.ro/ Gabi Solomon

    thanks you.

  • Ulrig

    Is there any new for the hotmail project?

  • http://www.yahooscan.eu Xpl0si0n

    other website with you can detect status is http://www.yahooscan.eu also with website you cand download your buddies avatar.

  • http://www.gsdesign.ro/ Gabi Solomon

    this is something different, not to detect the online state ;)

  • Sonic

    Gabi Solomon ;

    Can't we found a way to do the same thing for hotmail ?

  • http://www.buzzu.info Buzzu

    Check out this great Yahoo invisible detector i use... has a lot of features!

  • 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

  • http://www.gsdesign.ro/ Gabi Solomon

    you can find out the url for co.uk by looking at the registration form and searching for the url in view source

  • http://tes-design.com Tesfalem

    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

  • http://www.gsdesign.ro/ Gabi Solomon

    @ Tesfalem
    what is the problem

  • http://tes-desugn.com tesfalem

    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

  • http://www.gsdesign.ro/ Gabi Solomon

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

  • Norman

    Hi,

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

    Thanks

  • ismail

    can i know all yahoo ids of a particular user?

  • swetha

    can i have code for checking users of yahoo

  • http://www.hybridsolution.eu/ Cristian

    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 ?

  • http://www.byeloo.com/ detect

    try Byeloo! http://www.byeloo.com! :D ! it's much easyer

  • 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...

  • http://profiles.yahoo.com/u/PMOSASRXC7WFE6FIHMONUX336I Marius Olteanu

    The best Yahoo Invisible Detector http://www.detector-invisible.com scanner 100% accurate.

  • http://ytilis.com/ 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!

  • http://pulse.yahoo.com/_OJD4JWDQ4SYMH6NKTMBOAYFJZ4 JeffT

    pretty slick!

  • gec

    Yahoo invisible status detector: http://www.Jdetector.com - 100% accurate.

  • Lol

    NOT Working !!