Introduction

Welcome to the JsonLink API documentation. This API provides functionalities for extracting information and taking screenshots of webpages.

Authentication

To access the JsonLink API, you must authenticate your requests using an API key. This key allows you to make requests to the API and track your usage.

To get started, sign up for a free account on JsonLink.io. Once you have created an account, you can copy your API key.

To authenticate your API requests, include your API key as a query parameter in the URL:

https://jsonlink.io/api/endpoint?api_key=<YOUR_API_KEY>

For example, a request to the screenshots endpoint would look like this:

https://jsonlink.io/api/screenshot?api_key=<YOUR_API_KEY>&url=https://example.com

Ensure that you keep your API key secure and do not share it publicly. If you believe your API key has been compromised, you can regenerate it from your account dashboard.

Get a Free API Key

Rate Limitation

To ensure fair usage and maintain optimal performance, the JsonLink API enforces rate limits based on your subscription plan. These limits control the number of requests you can make within a specific time frame.

Each subscription plan has its own rate limits, defined by the number of requests allowed per minute and per hour. For detailed information on the rate limits associated with each plan, please visit our Pricing page.

View Plans & Pricing

Understanding Rate Limit Headers

Every API response includes headers that provide real-time information about your current rate limit status. These headers help you monitor and manage your API usage effectively.

  • X-Rate-Limit-Limit: The maximum number of requests allowed in the current time window.
  • X-Rate-Limit-Remaining: The number of requests remaining in the current time window.
  • X-Rate-Limit-Reset: The UNIX timestamp indicating when the current rate limit window will reset.

If you exceed the allowed number of requests within the defined time frame, the API will respond with an HTTP status code 429 Too Many Requests. The response body will contain a JSON object detailing the error.

Rate Limit Error Response Example:


{
"success": false,
"error": "Too many requests"
}

When you receive a 429 error, you should implement a retry mechanism with exponential backoff to avoid further exceeding the rate limits. Additionally, review your current usage and consider upgrading your plan if necessary.

Best Practices

  • Monitor the X-Rate-Limit-Remaining header to track your remaining requests.
  • Implement error handling for 429 Too Many Requests responses.
  • Optimize your application to minimize unnecessary API calls.
  • Consider upgrading your plan if you consistently hit the rate limits.

Responses

Success Responses

Details about successful responses and their structure.

Error Responses

Details about error responses and how to handle them.

GET API Extract

The Extract endpoint allows you to retrieve essential metadata from a given URL, such as the page title, description, images, and more. This is useful for generating previews or summaries of web content. To use this endpoint, simply provide the target URL along with your API key.

Play with this endpoint here: Extract Metadata API Playground.

Endpoint URL

https://jsonlink.io/api/extract?api_key=<API_KEY>&url=<URL>

Required Parameters

  • api_key: Your API key obtained from JsonLink. You can create a free account to get your API key.
  • url: The full URL of the web page you want to extract metadata from.

Successful Response

If the request is successful, the API will return a JSON object containing various metadata about the URL. Here’s an example response:


{
"title": "Crea Imágenes con Frases online y gratis – Crea Tu Frase",
"description": "Crea imágenes con frases para compartir con nuestro creador de frases online y gratis! Descarga y comparti frases en las redes sociales.",
"images": [
"https://tufrase.com/img/socialshare.jpg"
],
"sitename": "Tu Frase",
"favicon": "https://tufrase.com/favicon-32x32.png",
"duration": 1576,
"domain": "tufrase.com",
"url": "https://tufrase.com"
}
  • title: The title of the web page.
  • description: A short description of the web page content.
  • images: An array of image URLs extracted from the web page.
  • sitename: The name of the website.
  • favicon: The URL of the site's favicon.
  • duration: The duration of any video content, if present, in seconds.
  • domain: The domain of the website.
  • url: The original URL that was provided.

Error Response

If there is an error with the request, such as a timeout or an invalid URL, the API will return a JSON object with an error message. Here’s an example error response:


{
"error": "REQUEST_TIMEOUT"
}
    

Best Practices

  • Ensure that the URL provided is complete and properly encoded.
  • Check the returned JSON structure to verify that all desired metadata is present.
  • Handle potential errors gracefully by checking for the error field in the response.

GET API Screenshot

The Screenshot endpoint allows you to capture a screenshot of a given web page. You can customize various options such as viewport size, format, and quality. This endpoint is particularly useful for generating visual representations of web pages for monitoring or archival purposes.

Play with this endpoint here: Take Screenshots API Playground.

Endpoint URL

curl https://jsonlink.io/api/screenshot?api_key=<API_KEY>&url=<URL>

Required Parameters

  • api_key: Your API key obtained from JsonLink. You can create a free account to get your API key.
  • url: The full URL of the web page you want to capture.

Optional Parameters

  • viewport_width: Set the width of the browser viewport (in pixels). Default is 1920.
  • viewport_height: Set the height of the browser viewport (in pixels). Default is 1080.
  • device_scale_factor: Set the device scale factor (useful for high-resolution displays). Accepts values from 1 to 3. Default is 1.
  • format: The format of the screenshot image. Options are png or jpg. Default is jpg.
  • quality: The quality of the screenshot (only applicable for jpg format). Accepts values from 0 to 100. Default is 80
  • full_page: If set to true, captures the entire page, not just the visible portion. Default is false.

Successful Response

If the request is successful, the API will return a JSON object with the path and URL of the saved screenshot. Here’s an example response:


{
    "path": "screenshots/5afc57bb-0e31-45bf-8e53-d9f016fa9bf9.jpg",
    "url": "http://jsonlink.io/screenshots/5afc57bb-0e31-45bf-8e53-d9f016fa9bf9.jpg"
}

  • path: The relative path to the screenshot file on the server.
  • url: The URL where the screenshot can be accessed. Note: Hotlinking is not allowed, and screenshots are deleted after 7 days.

Best Practices

  • Ensure that the URL provided is complete and properly encoded.
  • Use the format and quality parameters to optimize the file size and image quality according to your needs.
  • Be aware of the rate limits to avoid receiving a 429 Too Many Requests error.
  • Remember that screenshots are deleted after 7 days, so save them locally if you need to keep them longer.

GET API Images

The Images endpoint allows you to extract all the available images for given web page. You can extract information like size, format, and resolutions.

Play with this endpoint here: Extract Images API Playground.

Metadata Scraper Extract Links Screenshots API Link Preview Extract Images

Endpoint URL

curl https://jsonlink.io/api/images?api_key=<API_KEY>&url=<URL>

Required Parameters

  • api_key: Your API key obtained from JsonLink. You can create a free account to get your API key.
  • url: The full URL of the web page you want to capture.

Successful Response

If the request is successful, the API will return a JSON object with the path and URL of the saved screenshot. Here’s an example response:


{
    "images": [
        {
            "url": "https:\/\/tufrase.com\/img\/isologo-h.svg",
            "src": "\/img\/isologo-h.svg",
            "format": "svg",
            "width": 300,
            "height": 109,
            "basename": "isologo-h.svg",
            "name": "isologo-h",
            "size": 3590,
            "mime_type": "image\/svg+xml"
        }
    ]
}