import mql from '@microlink/mql' const { data } = await mql('https://github.com/microlinkhq', { headers: { userAgent: "googlebot" } })
Endpoint
Microlink API is exposed from two endpoints:
- free (api.microlink.io): The endpoint to be used for unauthenticated requests. It has daily rate limit.
- pro (pro.microlink.io): The endpoint to be used for authenticated requests. It needs a previously register API key.
All you need to do for accessing any of these endpoints it to hit them using HTTP GET method, nothing else.
Any additional API Parameter needs to be provided as query parameter.
The endpoint accepts multiple query parameters. It doesn't matter if they are camel or snake case, both styles are supported.
import mql from '@microlink/mql' const { data } = await mql('https://github.com/microlinkhq', { headers: { user_agent: "googlebot" } })
Provide the same API parameter but using snake_case has the same effect.
If you are using Microlink Query Language (MQL), the endpoint is automatically determined in case you provide an API Key.
import mql from '@microlink/mql' const { data } = await mql('https://github.com/microlinkhq', { headers: { apiKey: "YOUR_API_TOKEN", userAgent: "googlebot" } })