API-BP - M4L3V3 - Querying, Filtering and Pagination
API-BP - M4L3V3 - Querying, Filtering and Pagination
Faculty
Querying, Filtering, and Pagination
Enterprises use REST APIs to provide access to their
data and services
• Large datasets returned by REST APIs can cause
bandwidth and processing issues
• User interfaces typically show limited data, requiring
efficient data management
GET http://www.foo.com/books?offset=0&limit=25,
• Meaning retrieve the first 25 books
• Subsequent items require adjusting the offset value
Limiting via Query-String Parameters
The parameters, offset and limit, are not standardized
Faculty
Filtering
Filtering restricts the results returned in an API
response by specifying additional search criteria
• Example: GET
http://www.foo.com/users?filter="name::mahesh|city
::mumbai"
Faculty
Summary
In this video, you have learned about:
• Effective API design which involves implementing
features
• Like filtering and pagination
Faculty
MCQ1
Which delimiter is commonly used to separate
individual filter phrases in a query-string parameter for
filtering in RESTful APIs?
a) Comma (,)
b) Vertical bar (|)
c) Colon (:)
d) Ampersand (&)
Faculty