Shazam API free

免费增值
通过 DiyorjonAxmadjonov | 已更新 vor 2 Monaten | Music
人气

9.3 / 10

延迟

1,150ms

服务等级

100%

Health Check

100%

返回所有讨论

Using API in PowerShell

Rapid account: Wagsat 12
wagsat12
vor 2 Monaten

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 vor 2 Monaten

binary

Rapid account: Wagsat 12
wagsat12 Commented vor 2 Monaten

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 vor 2 Monaten

it is possible

Rapid account: Wagsat 12
wagsat12 Commented vor 2 Monaten

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 vor 2 Monaten

have you tried with another mp3?

加入讨论 - 在下面添加评论:

登录/注册以发布新的评论