Skip to main content

Best Practices

This section contains best practices for using the API. It is not a complete list of all the best practices, but it is a good starting point. If you encounter any questions, don't hesitate to contact us.


Limits and Efficiency

To ensure that your application is efficient and does not overload the API server, it is important to follow the following best practices:

  • Minimize API calls to increase efficiency and reduce latency.
  • Proper usage of the limits property to transfer only necessary data, avoiding excessive data transfer and reducing response time.
  • Utilize API pagination functionality, such as the mandatory limit and optional offset, to retrieve large data sets in chunks. When retrieving large data sets, it is important to use the limit parameter to limit the number of results returned in each request. This will reduce the amount of data transferred and improve the response time. The offset parameter can be used to retrieve the next chunk of data. The preferred way is to use a higher limit and iterate over the results using the offset parameter instead of making multiple requests with a lower limit. This will reduce the number of API calls and improve the response time.
  • Cache data locally where possible to reduce API calls and improve speed.
  • Optimize your API requests by using appropriate filters and parameters.
  • Follow rate limiting guidelines to avoid overloading the API server. This can include limiting the frequency of API calls or using efficient queries to minimize individual calls.
  • Ensure that your application is designed to handle potential errors, such as timeouts or server errors, and can recover gracefully from them.

Featuring Data in Publications and Websites

When you feature data from our API in any publication or website, it is important to give credit to the source of the information. This is a common practice in the field of data journalism, where it is considered good ethical behavior. By attributing the data, you help to build trust in the accuracy of the information. To give proper attribution, you can include a footnote or mention the API by name in the text of your publication or website. You may also consider linking back to us. The exact form of attribution may vary depending on the style guide you are following, but the key is to be clear and concise about the source of the information.

Best practice is to attribute Source: Stakingrewards.com with a rel="dofollow" backlink on each individual page where the data is featured:

<a href="https://stakingrewards.com" rel="dofollow">Source: Stakingrewards.com</a>

Security

To ensure the security of your API integration, it is important to follow the following best practices:

  • Store API keys securely to prevent unauthorized access to the data. Consider using environment variables or encrypted key storage solutions.
  • Avoid hardcoding endpoint URLs in your code. Instead, use dynamic URL construction to allow for easier updates to the API endpoint in the future.
  • This one should be obvious, but: keep software and operating systems up to date.

Data Integrity

To ensure the integrity of the data you retrieve from our API, it is important to follow the following best practices:

  • Validate the retrieved data before processing it to ensure it meets the necessary standards and requirements.
  • Ensure that the data is properly formatted and that all required fields are present.

Terms of Service, Updating and Maintenance

To ensure that your application continues to function properly, it is important to follow the following best practices:

  • Follow the terms of service to ensure that your application is compliant with the API usage guidelines.
  • Stay up-to-date with the latest API version and changes to ensure the continued functioning of the API integration.