wouldn't it be easier to search the ARIN Database for a WHOIS lookup? If it's returned, it's registered; otherwise, it's open. Actually, this one will do you better. Check any domain in the world:
AllWhois.com
You can't guarantee the output will not change in layout; however, you can still use it.
Once you learn what items to post to it (probably through cURL), and get the response text, it's a matter of parsing it, and finding the portion that looks like this:
<tr>
<td width="100">
<img src="/images/searchresults.gif" align="bottom" height="20" width="100"><br>
</td>
<td width="20">
<img src="/images/search-notavailable.gif" align="bottom" height="20" width="20"><br>
</td>
<td class="small">
Domain Taken<br>Please Search Again<br>
Domain name is currently unavailable for registration
</td></tr>
Or this for an available domain:
<tr>
<td width="100">
<img src="/images/searchresults.gif" align="bottom" height="20" width="100"><br>
</td>
<td width="20">
<img src="/images/search-available.gif" align="bottom" height="20" width="20"><br>
</td>
<td class="small">
Domain name is available and may be registered today!
</td></tr>
Then, based upon that, you can determine whether it's available or not.