Machine readable database of gamma lines Friends of mine did a lab experiment where they recorded $\gamma$-spectra in the range from 0 to 1500 keV with a soil sample. The data contains some background and a couple sharp peaks at different locations. Their task is to find the isotopes contained in that sample.
There are of course thousands of isotopes with tens to hundreds of decay lines each. My suggestion was to take some database of lines and built up the expected spectrum. Then try to match those spectra to the measurement. So if $m(E)$ is the energy and $s_i(E)$ are the spectral functions generated by
$$ s_i(E) = \sum_{j} \sigma(E') \delta(E - E'_{ij}) $$
where $E_{ij}$ are the $j$th spectral line of the $i$th isotope. To match them I suggested to do $$a_i = \frac{\int_0^\infty \mathrm d E \, m(E) s_i(E)}{\int_0^\infty \mathrm d E \, s_i(E)}$$
that would give some measure how well the peaks of the isotope are present in the measurement. In the numerical calculation the $\delta$-peaks are modeled by Lorentz-peaks.
In order to do that they were looking for some machine readable database. They have found this site where you can query for specific energy ranges and get a list of isotopes. That is somewhat interesting, but there are so many lines in every energy range that it does not really help. Also it is not machine readable until you query and parse the whole energy range and store it to a local SQLite database or so. Then they also found another site where you can download plain text files. However they turned out to contain only some isotopes. Some of the lines of the first site are not contained on the second which is a problem.
This is what the best fitting generated spectra and the data looks like at some energy:
http://chaos.stw-bonn.de/users/mu/uploads/2015-11-28/isotopes.png
Is there some machine readable database of $\gamma$-decay lines such that they can programatically check for the best matching lines?
 A: Answering the Question as Asked
The raw data is available from a unreasonable and unmanageable slew of papers published in endless venues over the last upteen decades. Ouch.
The processed data is available in the form of ENDFs (evaluated nuclear data files) maintained by several agencies (i.e. these is a Japanese adgency that maintains the JENDFs), but even those require much processing of many files to extract a simple set of results. This is still a pain, but nothing like the nightmare of going after the raw data.1
You can also get the old style bound-books table-of-the-isotopes and vgrep the decay lines from there. This is even more painful than it sounds. 
General advice.
Looking at your data and your fit, two big things jump out at me.


*

*You are trying too hard too soon. Start by only getting a good fit to the most prominent peaks.

*You may very well have a energy calibration issue. You should be able to guess from the nature of the sample and the construction of the detector what you biggest expected peaks should be, and if they won't fit you may need to re-do the energy calibration.2 
Overall Approach
In your places I would 


*

*Generate a SQL file from http://nucleardata.nuclear.lu.se/toi/radSearch.asp

*Develop a query that selects results only from isotopes with some minimum product of $(\text{expected abundance} * \text{expected activity})$ in the materials of your apparatus and sample.3 

*First match only the most prominent lines in you spectra and use those to calibrate the energy scale of your detector (a difficult step with, say, a germanium detector when trying to high precision work).

*Sort through the resulting mess by hand to select the most likely seeming candidates to match your spectra. Adjust the threshold down if you have too many hits and up if too few.

*You may want to match most of the range, then deal with trouble spots one at a time.


Finally, it may not be worth trying to get absolutely every last peak properly labeled.

1 In one case (only one!) I "checked" the ENDF for a particular capture cross-section by running down and rationalizing the raw data myself. Two and a half work-weeks later my file differed by no more than a couple of percent from the official one over the entire range, and that in the regions where two or more sources disagreed with one another. Never again.
2 I am guessing that you are using a germanium detector here. They have an annoying, almost-but-not-quite linear behavior over large swaths of their energy response.
3 You'll be calculating the abundance*activity product by hand at first. Later it might be worth automating, but don't start that now: it's months of work.
