Many developers use an example-driven approach when looking for resources to learn or even remind themselves on how to invoke a web API. Nobody these days tends to sit down and go through an offical reference documentation page after page. While searching for Stack Overflow posts is very useful, sometimes you want to see how a particular invocation in the context of a real application. However, using GitHub search to find such applications can be frustrating, because GitHub search, being a keyword search, does not understand the semantics of code to always return sensible results.
The Alchemy Data News API “provides news and blog content enriched with natural language processing to allow for highly targeted search and trend analysis.” You can invoke this service via the
GetNews endpoint. Officially, there are 12 query parameters. The lessons learned in API Harmony highlight three that are frequently used in other code found in GitHub:
end. All of these three fields were used 6 out of 7 times when the
GetNews endpoint was invoked.
As I’m new to Alchemy Data News API myself, what caught my eye was that the
end query parameter was frequently set to
now, a value that seems quite specific to this API that I wouldn’t have known.
To see the context of how other people also make this call, API Harmony picks out three examples. Clicking one of these example links brings you right to the GitHub source code the lessons are extracted from.
What other information would you as a developer find it a good lesson learned? Can you share a good lesson learned that perhaps tripped you up before?