An API is a product, even if it isn't sold for money. Customers rely on an API to solve their problems, and it becomes an intrinsic part of their web service. Thus, like any product, a company should consider the API's lifetime, and how to responsibly sunset and deprecate their API.
What is the difference between sunsetting an API and deprecating it? Deprecation means the API is no longer supported, and should no longer be used. In some cases, it may still operate. A deprecated API is defined by the IETF in the Deprecation HTTP Header, and includes a required header that must precede a deprecated or sunsetting API. For example:
```yamlDeprecation: Sun, 11 Nov 2018 23:59:59 GMT```
or if the date is unknown, `Deprecation:true`. This tells a user, who may not have read the API's documentation that the API is no longer supported. You may want to add a link below, Link: https://app.abstractapi.com/api/scrape/tester; rel=”deprecation”; type=”text/html” to provide your reasoning to customers, and perhaps suggest a new alternative or migration endpoints.
Sunsetting is a descriptive term meaning the API is on its way to being deprecated. The API developers let their users know that the API is entering a period of limited support and eventual deprecation, and they should look for a replacement option for their API. Sunsetting is also communicated to users with an HTTP header.
```yamlSunset = HTTP-date```
You can add a link below the Sunset header too: Link: https://app.abstractapi.com/api/scrape/tester; rel=”deprecation”; type=”text/html”.
Similar to API versioning, a company needs to consider its customers when an API is undergoing deprecation. Ideally, they had a long term plan set out already that included some of the following.
API deprecation and sunsetting are important considerations. Even if you aren't making money off an API, your software could be a fundamental pillar of someone's ecosystem, and to just deprecate it overnight would be disastrous for them. Gather analytics, make your decision, and communicate your intent clearly to your customers, so you can maintain their goodwill when you build your next API.