Request and response structure

This document is intended to provide examples on how to make a call to our API and the structure of the response that is returned.

Request structure - Example API call

curl --location --request GET 'https://staging.dev.graphitehq.com/api/il/related-links/<Project_shortuuid>?url=https://www.example.com/blog/my-blog-post \
--header 'Authorization: Bearer <API_KEY>'

Notes:

  • The API Key must be provided with a bearer token in the request headers
  • The URL to query must be provided in a query param with key URL
  • The project short UUID is shown on the API configuration page
  • All of the related links for the given page are returned grouped by modules

Response structure

{
    "6NYkGsxX9UhhACJnqKZXip": {
        "from": "/section1",
        "to": "/section2",
        "links": [
            {
                "url": "https://www.example.com/section1/Example-Page-123456",
                "title": "This Is My Title",
                "description": "The description of my page appears here.",
                "image_url": "https://www.example.com/images/Example-Page-123456"
            },
            {
                "url": "https://www.example.com/section2/Example-Related-Page2-123456",
                "title": "This Is My Other Title",
                "description": "The description of my other page appears here.",
                "image_url": "https://www.example.com/images/Example-Related-Page2-123456"
            }
        ]
    }
}

Note: If there are multiple modules on the originating page type, we will return all modules of the originating page type in the API response.

Requests rate limits

The API endpoints are not restricted by request rate limits; however, we encourage keeping the requests under 20 requests/second per endpoint. Updating data for a set of 10k pages will be done in less than 10 minutes.

When using the API endpoints to get data by batches, the API users should plan their jobs accordingly, considering the number of pages and the data update period, which could vary from one day to one week.