You could use SolveBio's Python client for this (disclosure, I work there). It's fast and will do exactly what you want. Right now we have GENCODE in our Data Library - GENCODE19 in particular is in hg19/GRCh37. If there's a different transcript annotation library you'd prefer, just request it and we'll add it.
Basically, you sign up for an account with SolveBio (it's free for academics), then run the following commands in your terminal (full tutorial/documentation is available here).
$ pip install solvebio
$ solvebio login
$ solvebio
The last command will open up our Python shell (you can also write a script and do import solvebio - if you're interested, I can write up a sample iPython notebook for that). Once you're in the Python shell, you can just type
gencode = Dataset.retrieve('GENCODE/GENCODE19')
results = gencode.query().filter(feature='gene').range(8,119331103,119331103)
for result in results:
print result['gene_symbol']
And that'll print out SAMD12 and AC023590.1 (if you change the filter to .filter(feature='gene',gene_status='KNOWN')
, you'll get only SAMD12).
You can even do it as a one liner if you want
Dataset.retrieve('GENCODE/GENCODE19').query(fields='gene_symbol').filter(feature='gene',gene_status='known').range(8,119331103,119331103)
It's all very pythonic, so you can iterate through all the results in ways you expect.
Do you have annotation files for each of the genome builds or would you instead need to query that information (e.g., via SQL)?
I don't have the annotation files and I would like to query ensembl online instead of locally.
If you have a long list of coordinates then I would suggest you doing it locally using tools such as bedtools, BEDOPS. See:http://bedtools.readthedocs.org/en/latest/content/tools/window.html
Guys thank you for all your tips. I am trying them out and I will let you know.