Most of this is out-dated, but the last two for stakes races still has some value.
BRIS provided it at one time.
I would certainly check before using it for other than personal uses, but at least it is there for folks to use themselves. Probably not for what you what it for.
BRIS numbers are not public domain.
http://horseracingdatasets.com/