PullMonkey Blog

17 Jan

VIN API - PHP and XML Parsing


Thanks go to Michael for sharing his hard work with the rest of you VIN API and PHP developers :)
I hope this helps -



10 Responses to “VIN API - PHP and XML Parsing”

  1. By Page Smith on Mar 21, 2011 | Reply

    Hi Guys, this is fantastic stuff! Could you please show where in the above PHP implementation I would indicate the “complete = true;” option? Would I need to remove the array for this to work?

    Sorry I just saw examples of how to return all variables in Ruby and Windows Server implementations, but didn’t catch a PHP way to return ALL xml variables available.

    Also, one other question, I did get a working test going and tried multiple very popular manufacturers and models of cars but basic things like the “Transmission:” type never came back for me, even though they were listed in the above code example. Do you find this common or perhaps was there a code issue?

    Thanks in advance! If I can get this running well I will have someone willing to continually buy VINs from you haha.

  2. By charlie on Mar 21, 2011 | Reply

    1) add ?complete=true, like this:
    curl_setopt ($curl, CURLOPT_URL, ‘http://vinapi.skizmo.com/vins/’.$vin.’.xml?complete=true’);

    2) Interesting, I’d like to take a look, please send me an email with the VINs that did not return transmission data - support at mrquotey dot com

    Great :)

  3. By Robin Daugherty on Mar 28, 2011 | Reply

    Page, to go through all of the items returned in the XML, you’ll need to parse it. There are a few libraries to do this. I use SimpleXMLElement:

    $e = new SimpleXMLElement($this->xml);

    foreach($e->children() as $item) {
    $name = $item->getName();
    $value = (string)$item;
    }

  4. By Page Smith on Mar 28, 2011 | Reply

    Thank you both, that is a great help in understanding this a bit more!

  5. By vlad on Oct 9, 2011 | Reply

    I want to use vinapi on my site. Can anyone help me?

  6. By charlie on Oct 9, 2011 | Reply

    Sure - are you having a specific problem? What language are you working with? Are you a developer?

  7. By vlad on Oct 9, 2011 | Reply

    I want to use php. I’m a not a developer. I dont know how can I start this script. I want to buy vin packages and use on my site to decode vins for check auto parts compatibility.

  8. By charlie on Oct 9, 2011 | Reply

    You can find a php example here - http://vinapi.skizmo.com/examples

  9. By Ron Eskinder on Jan 21, 2012 | Reply

    Hi,

    i need to get an API key to be able to use the VIN decoder, what do i have to do to get one
    Thanks

  10. By charlie on Jan 21, 2012 | Reply

    Hey Ron -

    Starting from http://vinapi.skizmo.com, there is a signup link in the upper-right of the page.
    This link will take you here - http://vinapi.skizmo.com/signup
    After signing up, you’ll get your API key and 20 free VINs with which to test.
    After that, you can take a look at the packages and prices of what we offer - http://vinapi.skizmo.com/packages_and_pricing

    If you have any questions, just let me know,

    - Charlie

Post a Comment