# Retrieve all Metadata

**URL:** <https://community.metabrainz.org/t/retrieve-all-metadata/342396>\
**Category:** AcoustID\
**Tags:** pyacoustid, acoustid\
**Created:** [November 18, 2017, 6:17pm UTC](https://community.metabrainz.org/t/retrieve-all-metadata/342396 "2017-11-18T18:17:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![adityamenon](https://community.metabrainz.org/letter_avatar_proxy/v4/letter/a/f04885/32.png) [@adityamenon](https://community.metabrainz.org/u/adityamenon)\
**Post date:** [November 18, 2017, 6:17pm UTC](https://community.metabrainz.org/t/retrieve-all-metadata/342396/1 "2017-11-18T18:17:34Z")

</div>

Hey,  
I’m trying to use acoustid through the code at [https://github.com/beetbox/pyacoustid](https://github.com/beetbox/pyacoustid)  
However i’m only getting track name and artist names, how can I get all the available metadata for a song?

Thanking you,

Aditya

---

<div class="post-metadata">

**Author:** ![derobert](https://community.metabrainz.org/user_avatar/community.metabrainz.org/derobert/32/1350_2.png) [@derobert](https://community.metabrainz.org/u/derobert)\
**Post date:** [November 18, 2017, 9:08pm UTC](https://community.metabrainz.org/t/retrieve-all-metadata/342396/2 "2017-11-18T21:08:11Z")

</div>

You need to use the returned recording ID with a MusicBrainz API client to get the rest of the metadata. Not a Python programmer, though, so I’m afraid my attempt to point you to one would be no better than Google (which returns several).

---

<div class="post-metadata">

**Author:** ![adityamenon](https://community.metabrainz.org/letter_avatar_proxy/v4/letter/a/f04885/32.png) [@adityamenon](https://community.metabrainz.org/u/adityamenon)\
**Post date:** [November 19, 2017, 3:57am UTC](https://community.metabrainz.org/t/retrieve-all-metadata/342396/3 "2017-11-19T03:57:36Z")

</div>

Ah okay, Thanks man 🙂  
But i’m still a bit confused, if anyone could help me out it’d be great!

---

<div class="post-metadata">

**Author:** ![loujin](https://community.metabrainz.org/user_avatar/community.metabrainz.org/loujin/32/126_2.png) [@loujin](https://community.metabrainz.org/u/loujin)\
**Post date:** [November 19, 2017, 10:21pm UTC](https://community.metabrainz.org/t/retrieve-all-metadata/342396/4 "2017-11-19T22:21:06Z")

</div>

@adityamenon: If you have `pyacoustid` and `musicbrainzngs` I guess something like that should work (my code should be py2/py3 compatible):

```
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from pprint import pprint

import acoustid
import musicbrainzngs

# replace by your own
API_KEY = 'cSpUJKpD'

# replace by your own
musicbrainzngs.set_useragent("loujine-test", "0.0.1",
                             "https://community.metabrainz.org/t/retrieve-all-metadata/342396")

# replace
filename = "..."

for result in acoustid.match(API_KEY, filename):
    mbid = result[1]
    print(mbid)
    recording = musicbrainzngs.get_recording_by_id(mbid, includes=['artists', 'releases', 'media'])
    pprint(recording)

```

Here `recording` should contain the JSON data
