This question varies greatly, and depends on where you are located. Most major cities will have links in their formal websites, offering searchable databases for building violations (e.g. Chicago). Other times, you can check the recorder of deeds office of your county and search for public records related to your property. Sometimes violations are posted with the recorder of deeds.