Skip to content

Instantly share code, notes, and snippets.

@CoreyAR CoreyAR/RAI_API.md
Last active Sep 15, 2018

Embed
What would you like to do?
Nashville Music Hackathon RAI Api information

Bearer Token

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoiZXh0ZXJuYWwiLCJhY2NvdW50SWQiOiI1Yjk5M2QxMDA0YmJhZDJlMjU4YjMyNTAiLCJzZXNzaW9uSWQiOiJhMDEzNzA3Mi0wZDFiLTQ4ZWEtODNlMy01YWVmMDkzNzc3NzQiLCJpYXQiOjE1MzY3NjkzMjQsImV4cCI6MTUzNzM3NDEyNH0.eDoL4cATx__N5pP-s4BlrsYsbn8PtQl0MWVBYr_yapk

Docs

The RAI API has two endpoints Parse and Resolve. RAI documentation

Python Example

import requests

token = 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoiZXh0ZXJuYWwiLCJhY2NvdW50SWQiOiI1Yjk5M2QxMDA0YmJhZDJlMjU4YjMyNTAiLCJzZXNzaW9uSWQiOiJhMDEzNzA3Mi0wZDFiLTQ4ZWEtODNlMy01YWVmMDkzNzc3NzQiLCJpYXQiOjE1MzY3NjkzMjQsImV4cCI6MTUzNzM3NDEyNH0.eDoL4cATx__N5pP-s4BlrsYsbn8PtQl0MWVBYr_yapk'

headers = { 'Authorization': token }


# Parse 
data = { 'title': 'Shake It Off' }
r = requests.post('https://api.cultofrai.com/api/parse', headers=headers, data=data)
print(r.text)

# Resolve
params = { 'albumTitle': 'Shake It Off' }
r = requests.get('https://api.cultofrai.com/api/resolve', headers=headers, params=params)
print(r.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.