Shazam API free

FREEMIUM
By DiyorjonAxmadjonov | Updated एक महीने पहले | Music
Popularity

8.9 / 10

Latency

2,514ms

Service Level

98%

Health Check

100%

Back to All Discussions

Using API in PowerShell

Rapid account: Wagsat 12
wagsat12
2 महीने पहले

I’m trying to use the API in PowerShell, but I don’t understand how to pass the audio file to the WebRequest. I have tried passing the filename and I have tried imbedding the raw MP3 in the body, but i always get “could not be determined”. But if I use the same MP3 file from the RapidAPI playground Test Endpoint it works.

This is my code:

headers=@headers=@{} headers.Add(“content-type”, “multipart/form-data; boundary=—011000010111000001101001”)
headers.Add("XRapidAPIKey","xxx")headers.Add("X-RapidAPI-Key", "xxx") headers.Add(“X-RapidAPI-Host”, “shazam-api-free.p.rapidapi.com”)

$response = Invoke-WebRequest -Uri ‘https://shazam-api-free.p.rapidapi.com/shazam/recognize/’ -Method POST -Headers $headers -ContentType ‘multipart/form-data; boundary=—011000010111000001101001’ -Body '-----011000010111000001101001
Content-Disposition: form-data; name=“upload_file”; filename=“1-05 Wild Honey Pie.mp3” Content-Type: audio/mpeg

-----011000010111000001101001–

Rapid account: Diyorbekkanal
diyorbekkanal Commented 2 महीने पहले

binary

Rapid account: Wagsat 12
wagsat12 Commented 2 महीने पहले

Unfortunately I’m not making any progress. I have tried uploading the file as a binary MP3, and I have tried encoding it as Base64. What format are you expecting the file?

Rapid account: Diyorbekkanal
diyorbekkanal Commented 2 महीने पहले

it is possible

Rapid account: Wagsat 12
wagsat12 Commented 2 महीने पहले

I’ve tried with multiple MP3 files. I think I am doing something wrong in the construction of the WebRequest.

Rapid account: Diyorbekkanal
diyorbekkanal Commented 2 महीने पहले

have you tried with another mp3?

Join in the discussion - add comment below:

Login / Signup to post new comments