I tried hitting the API with echonest's python client

What is echonest

The Echo Nest is a database of music information and seems to have been acquired by Spotify in 2014. The API of music information is open to the public. http://the.echonest.com/

Echonest's public library

http://developer.echonest.com/client_libraries.html

Tried environment

Centos 7.2 Python 2.7 This time I tried using Pyechonest

Install Pyechonest

easy_install -U pyechonest

Get API key

http://developer.echonest.com/ Create a free account here. You will receive an email confirming your account activation.

You should see Your API Key: on your Profile page https://developer.echonest.com/account/profile

Create a python file based on Examples

Show artists similar to Duke Ellington instead of Bikini Kill.

vi echotest.py

echotest1.py


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

from pyechonest import config
config.ECHO_NEST_API_KEY="YOURAPIKEY"

from pyechonest import artist
de = artist.Artist('duke ellington')
print "Artists similar to: %s:" % (de.name,)
for similar_artist in de.similar: print "\t%s" % (similar_artist.name,)

result

Artists similar to: Duke Ellington:
	Count Basie
	The Duke Ellington Band
	Earl Hines
	Woody Herman
	Count Basie Orchestra
	Stan Kenton
	Benny Carter
	Lionel Hampton
	Benny Goodman
	Teddy Wilson
	Johnny Hodges
	Fletcher Henderson
	Buddy Rich
	Duke Ellington Orchestra
	Harry James

The result seems to emphasize chronological correlation.

Show artist ID

echotest2.py


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

from pyechonest import config
config.ECHO_NEST_API_KEY="YOURAPIKEY"

from pyechonest import artist
a = artist.Artist('duke ellington')
print a.id

result

ARMI36C1187B99A462

Shows the birthplace of the Duke Ellington artist, the tempo of the song Perdido, and the length of the song

echotest3.py


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

from pyechonest import config
config.ECHO_NEST_API_KEY="YOURAPIKEY"

from pyechonest import song
de_results = song.search(artist='duke ellington', title='perdido')
perdido = de_results[0]
print perdido.artist_location
print 'tempo:',perdido.audio_summary['tempo'],'duration:',perdido.audio_summary['duration']

result

{u'latitude': 47.3917, u'location': u'Washington D.C. ', u'longitude': -121.5708}
tempo: 129.606 duration: 188.4

at the end

I wrote it because I wanted more articles on music APIs. http://qiita.com/hideyuki/items/8b5c6b02d0784aa25fd2

Recommended Posts

I tried hitting the API with echonest's python client
I tried "smoothing" the image with Python + OpenCV
I tried hitting the Qiita API from go
I tried "differentiating" the image with Python + OpenCV
I tried "binarizing" the image with Python + OpenCV
I tried scraping with Python
I tried to get the authentication code of Qiita API with Python.
I tried gRPC with Python
I tried scraping with python
I tried to get the movie information of TMDb API with Python
I tried hitting Mastodon API with Ruby (Faraday) / Python (Pycurl) / PHP (Curl)
I tried to touch the CSV file with Python
I tried to solve the soma cube with python
I tried to solve the problem with Python Vol.1
I moved the automatic summarization API "summpy" with python3.
I tried the Naro novel API 2
I tried web scraping with python.
Hit the Etherpad-lite API with Python
I tried the Naruro novel API
I tried running prolog with python 3.8.2.
I tried using the checkio API
I tried to find the entropy of the image with python
I tried "gamma correction" of the image with Python + OpenCV
I tried to simulate how the infection spreads with Python
A note about hitting the Facebook API with the Python SDK
I tried saving the DRF API request history with django-request
[Python] I tried collecting data using the API of wikipedia
I tried to divide the file into folders with Python
I tried scraping the ranking of Qiita Advent Calendar with Python
I tried to solve the ant book beginner's edition with python
Simple Slack API client made with Python
I tried scraping Yahoo News with Python
I tried sending an email with python.
I tried non-photorealistic rendering with Python + opencv
I tried using UnityCloudBuild API from Python
I tried a functional language with Python
I tried recursion with Python ② (Fibonacci sequence)
I tried to touch the COTOHA API
Python: I tried the traveling salesman problem
I tried playing with the image with Pillow
I tried to improve the efficiency of daily work with Python
I tried ChatOps with Slack x API Gateway x Lambda (Python) x RDS
I tried the Python Tornado Testing Framework
I tried using the BigQuery Storage API
#I tried something like Vlookup with Python # 2
I tried to verify the speaker identification by the Speaker Recognition API of Azure Cognitive Services with Python. # 1
I tried hitting the Google API with Ruby and Python-Make the database a Spreadsheet and manage it with Google Drive
I tried to verify the speaker identification by the Speaker Recognition API of Azure Cognitive Services with Python. # 2
[Python] I tried to visualize the night on the Galactic Railroad with WordCloud!
I tried to refer to the fun rock-paper-scissors poi for beginners with Python
I tried using "Streamlit" which can do the Web only with Python
I tried with the top 100 PyPI packages> I tried to graph the packages installed on Python
I tried to streamline the standard role of new employees with Python
I tried hundreds of millions of SQLite with python
[Python] I tried substituting the function name for the function name
vprof --I tried using the profiler for Python
I tried "License OCR" with Google Vision API
I tried to save the data with discord
I tried simulating the "birthday paradox" in Python
I tried L-Chika with Raspberry Pi 4 (Python edition)
I tried using the Google Cloud Vision API