Using Knime to Call Github Search API
If you have not yet heard of it, KNIME Analytics platform is an open source, free, fast, and versatile data workflow tool. Check it out at https://www.knime.com .
There are quite a few data integration and workflow tools available for analysts and engineers (see a small sampling of them here: Github repo: awesome-etl (Gui tools section)). Recently I have been using Knime a fair amount, and it is a fantastic tool. I have found it to be most competitive with expensive proprietary software packages in this space.
OK, So It Has Drag and Drop ETL. What Else Can It Do? **
I'm glad you asked! Another very helpful thing Knime can do is help you build low- or no-code REST API workflow integrations. Integrating with REST APIs (along with GraphQL and gRPC APIs) has become a critically important part of business data integration.
Scenario: Get a List of Github Repositories By Topic Search
The goal here is to search for some public Github repositories and get metrics associated with the repos. If the Topic I want to search for is "data integration," I will follow these four steps to make this happen using Knime and Github REST API:
The "recipe" for building the REST API Search URI is:
"search_url" concatenated with "search_type," then "?q=", and then "search_query"
When I execute the String Manipulation Component, the concatenated and properly formatted REST API URI result is shown in the screenshot:
Also, I need to add two HTTP Request header values (per the Github REST API documentation at the end of this post) before this request is ready to send to the Github REST endpoint.
Recommended by LinkedIn
Accept : "application/vnd.github+json"
Content-Type : "application/json; charset=utf-8"
We can then take a look at the JSON Response body as it is populated in the Knime flow:
At the time the Github API search was run, it returned a count of 78 records associated with the Topic search with parameter "data integration." When that output is saved to a local file, the file contains 3,167 lines of text. If I'm going to share these results with people who don't like reading JSON-encoded data (which == most people), then I will need to follow up by doing some parsing and data wrangling.
Summary
** By the way, the Drag and Drop ETL features of Knime are quite excellent.
Reference
#DataEngineer #Knime #OpenSource