Using Core CiviCRM Functions / Re: How to use Civi data to call external API, and return result to Civi?« Last post by JonGold on Today at 03:20:58 pm »
We've written some very similar code - for allied organizations of yours, in fact. I haven't used that NYC API before though.
What you'll want to do is write an extension. Check out this page: http://wiki.civicrm.org/confluence/display/CRMDOC/Create+an+Extension
Use the civicrm_post hook (http://wiki.civicrm.org/confluence/display/CRMDOC/Hook+Reference) and hook either addresses or contact records being saved (depends on your workflow). Use API calls to get the fields you need and pass them to php_curl. Parse the results that come back (you can probably get away with a search function instead of a full-blown XML interpreter) and use an API call to save the building number to a custom field.
This is probably a bit overwhelming if you haven't done it before - but once you've done it, you can knock out something like this in an hour or two. If you'd like to come to Brooklyn one day next week, you're welcome to set up a laptop next to me and hack at this and ask me questions when you get stuck.