API Endpoint
Query Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| location | string | The location coordinates (latitude,longitude) | Yes |
| locationRadius | string | The radius from the location to search within | Yes |
| type | string | The type of resource to search for | Yes |
Example Usage
To search for videos from London, you can make the following API call:index.ts
Response
The API will return a JSON object containing an array of video items. Each item includes:videoId: The unique identifier for the videotitle: The title of the videodescription: A brief description of the videothumbnails: Various thumbnail images for the videochannelTitle: The title of the channel that uploaded the video
Technical Details
- The
locationparameter uses the formatlatitude,longitude. For London, we use the coordinates51.5074,0.1278. - The
locationRadiusparameter specifies the geographic area in which to search. It must be used in conjunction with thelocationparameter. - The
typeparameter must be set tovideowhen using location-based search.
Error Handling
If the API call fails, it will return an appropriate HTTP status code along with an error message in the response body. Common errors include:- 400 Bad Request: Invalid query parameters
- 403 Forbidden: Token is missing or invalid