Question

I'm making a chrome extension that utilizes the YouTube Data API. I'm doing a simple query for keywords, and then creating embed links from the response.

I'm having trouble encoding the GET url. Mine looks something like this:

https://www.googleapis.com/youtube/v3/search?part=snippet&q=laughing...

When the query is one word, everything works great. But if I want to search for 'baby laughing', I can't seem to encode correctly. This link (https://developers.google.com/youtube/2.0/reference#qsp) says multiple word queries need to be URL escaped, which makes sense, but its not working as expected.

neither

...q=baby+laughing...

nor

...q=baby%20laughing...

Anyone know whats going on?

Thanks!

Was it helpful?

Solution

What exactly is not working?

This

https://www.googleapis.com/youtube/v3/search?part=snippet&q=baby+laughing

is working for me.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top