In Express.js, req.query is an object of parsed query-string parameters — everything after ? in the URL. For /search?term=express&limit=10, you get keys like term and limit.
Use it for optional filters, search, sort, and pagination. Path identity belongs on req.params. Configure parsing with app.set('query parser', …). The pathname alone is req.path.
Syntax
Read req.query in your Express.js route handler. Start with this line.
Express
req.query
req.query.page
req.query.sort
Call
What it does
req.query
Primary signature.
req.query.page
Related call form.
req.query.sort
Related call form.
Install with npm install express. Create the app with const app = express() before you use this API in an Express.js tutorial project.
Still validate. Nested shapes are still untrusted user input.
Compatibility
Runtime Support
req.query is an Express.js request property. It runs on a Node.js server (Express 5 needs Node.js 18+). Browsers do not execute it — they only send URLs with query strings to your app.
✓ Server · Express 4 & 5
req.query
Works wherever Express runs: Node.js is the primary target. Bun and Deno can run many Express apps with compatibility layers. Not available in the browser.
ServerNode.js runtime API
Node.js18+ for Express 5 · 14+ typical for Express 4
Supported
BunExpress-compatible server apps
Supported
DenoVia npm compatibility / adapters
Supported
req.queryExpress on Node.js
Bottom line: Study and run these examples with Node.js and the express package. Copy a snippet into a local file and start the server with node.
Frequently Asked Questions
It is an object of parsed query-string parameters from the part of the URL after ?, such as ?page=2&sort=asc.
Usually yes for simple keys. Repeated keys can become arrays. Nested objects need the extended query parser. Always coerce and validate before use.
req.query comes from the optional query string. req.params comes from named path segments defined in the route, like /users/:id.
app.set('query parser', …) chooses how the string is parsed: simple, extended, false (empty object), or a custom function.
No. It is a server-side Express request property. Browsers only send the URL; your app parses the query into req.query.