Proton affinities in machine readable format?
To my knowledge, a (Python) API for the NIST chemistry WebBook does not exist.

Rather than filling out the Search for Species Data by CAS Registry Number by hand, you might want to use mechanize. 

But since you're only interested in Gas phase ion energetics data anyway, you might want to construct the relevant URLs directly.

Isoprene:

http://webbook.nist.gov/cgi/cbook.cgi?ID=C78795&amp;Units=SI&amp;Mask=20#Ion-Energetics

Styrene:

http://webbook.nist.gov/cgi/cbook.cgi?ID=C100425&amp;Units=SI&amp;Mask=20#Ion-Energetics

The parameter pattern is obvious: ID is the CAS number of the compound minus the dashes, prefixed by C.