diff --git a/api/README.md b/api/README.md index cb1174b..eded595 100644 --- a/api/README.md +++ b/api/README.md @@ -1,7 +1,7 @@ # VideoAPI ## Search -`GET \api?param=value` +`GET /api/?param=value` ### Parameters | Param | Value | @@ -21,6 +21,4 @@ ``` ### Examples -> `GET /api?q=foo&limit=3` will return the first 3 videos with "foo" in their name. - - +> `GET /api/?q=foo&limit=3` will return the first 3 videos with "foo" in their name. diff --git a/api/views.py b/api/views.py index db931e7..5c20c50 100644 --- a/api/views.py +++ b/api/views.py @@ -7,7 +7,7 @@ from core.serializers import VideoSerializer @api_view(['GET']) def videoAPI(request): q = request.GET.get('q', '') - l = request.GET.get('limit', '') + l = request.GET.get('limit', '6') try: l = int(l) videos = Video.objects.filter(Q(id__contains=q) | Q(name__contains=q))[:l]