Product Brief #6:
Custom Rules & metadata improvements

June 30, 2018 ()

Custom rules

Custom Rules enables build custom API response based on your necessities.
Microlink API is so powerful for extracting data. We created links previews as one of the possible use cases (actually our SDK), but because the API response returns generic data, it's a bit difficult use Microlink API for different problems scope.
Now, we are introducing the concept of Custom Rules: The ability to setup custom API response based on user necessities.
Custom Rules work specifying what you want to get using CSS selectors. Also, you can provide consistent types (url, author, date, etc) avoiding getting unexpected value in your data.
In other words, you can use it as a scraper as service 🀯.
We wrote a specific blog explaining how to use custom rules, taking an Instagram profile as an example.

Compression documentation

Ensure to use *Accept-Encoding* for enabling compression
Althought we support brotli and gzip from the beginning, we added a specific section into the documentation.
Using it, it will save payload size up to 70%, so ensure you are using it!

Informational headers

$ curl -i -I -X GET

x-response-time : 21.518ms
x-fetch-mode    : fetch
x-fetch-time    : 618.055ms
The mission of these headers helps you optimize the response time of the API.
As part of the response header, we added two new headers to help optimize your API calls:


It returns the total amount of time used for processing the API call.


It specifies the way to content will be fetched.
It could be fetch or prerendering. The value is strongly related with prerender API parameter.


It expresses the amount of time spend just in the x-fetch-mode step.

Better contextual metadata

We added size and duration every time that Microlink API detects you are working with image or video πŸŽ‰.
The API response will look like:
  "status": "success",
  "data": {
    "video": {
      "url": "",
      "width": 1280,
      "height": 720,
      "type": "h264",
      "size": 7228264,
      "size_pretty": "7.23 MB",
      "duration": 28.533333,
      "duration_pretty": "29s"
Notes how we provided the field with pretty suffix as well. It's the same value but human readable πŸ‘Œ.

Join the community

All of these improvements or features are community driven: We listen to your feedback and act accordingly.
Whether you are are building a product and you need fancy previews, you’re an indie hacker or simply you like frontend stuff, come with us πŸ™‚.