filter

Type: <string>
A comma-separated list of data fields to pick from the response payload over the target url.
  • CLI
  • JavaScript
  • Shell
  • Python
  • Ruby
const mql = require('@microlink/mql')

const { status, data } = await mql('https://news.ycombinator.com', {
  filter: 'url,title'
})

mql.render(data)
You can use dot notation to reference a nested data field of the response payload.
Then the data payload is going to just get these data fields.
{
  "status": "success",
  "data": {
    "url": "https://news.ycombinator.com/",
    "title": "Hacker News"
  }
}
This parameter has been designed to make API payload tiny as possible, improving response bandwidth timing.