5

Are there any sources of machine readable IRS codes (e.g. state, country etc.)?

For example, on the 1099-B instructions, the 1f code on this form. However I would like avoid having to scrape the pdf document for this information.

To be clear, this question is general and not specific to the 1099-B form. The 1099-B is just being used as an example, and there are other forms that have much lengthier code lists.

1 Answer 1

4

It's difficult to know when to use the Stack Exchange "answer" field for an inconclusive answer, but after a review of the IRS's website, I don't see much sign of this, particularly for the 1f code on that form, but really, for anything. The most prominent source of structured data from the IRS that I found is the Tax Stats section, which isn't what you're looking for.

There's an extensive section for "e-file providers", including some PDF docs that articulate valid code values, but nothing machine readable that I see. Maybe they make that sort of stuff available to approved e-file providers?

Note that the 1099 form instructions you referenced are also available as HTML as well as PDF, although you'd still have to scrape free text.

This seems like a case where you are best off asking the IRS directly, both to get an authoritative answer, as well as to register public interest in more structured data from them. Also, while I know that tech folks are often inclined to simply fill out a form or send an email, this may be a case where a phone call would pay off. Sometimes (but definitely not always), a real-time human interaction helps cut to the chase, and can result in social referrals to people with better information or more access than you can find by impersonal electronic means. However, the IRS has not been very forthcoming with publishing machine readable data thus far.

3
  • I agree that it's not definitive, but thank you for the information.
    – Ryan Gates
    Jul 29, 2014 at 14:58
  • Yup - scraping the HTML @Joe linked to is probably the best you're going to get. While it's not the best case for scraping even, at least the data is structured into sections and anchor tags for titles as opposed to one big paragraph. Jul 29, 2014 at 15:02
  • 1
    @RyanGates I'll comment that it is possible to convert HTML to XML, which is much more parseable (don't try to parse HTML yourself, just find a utility to convert). Most programming languages have XML utility classes, like C#'s LINQ to XML, or libraries that other people have written in that language to parse XML. Jul 29, 2014 at 19:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.