ballerinax/nytimes.articlesearch Ballerina library
This is a generated connector for New York Times Article Search API v1.0.0 OpenAPI specification. With the Article Search API, you can search New York Times articles from Sept. 18, 1851 to today, retrieving headlines, abstracts, lead paragraphs, links to associated multimedia and other article metadata. Use the Article Search API to look up articles by keyword. You can refine your search using filters and facets.
Before using this connector in your Ballerina application, complete the following:
- Create NYTimes developer account
- Obtain tokens
To use the New York Times Article Search connector in your Ballerina application, update the .bal file as follows:
Step 1: Import connector
First, import the
ballerinax/nytimes.articlesearch module into the Ballerina project.
Step 2: Create a new connector instance
articlesearch:ApiKeysConfig with the API key obtained, and initialize the connector with it.
Step 3: Invoke connector operation
Now you can use the operations available within the connector. Note that they are in the form of remote operations.
Following is an example on how to look up articles by keyword using the connector. You can now search for NYT articles by keywords, filters and facets. Here we have searched for articles with the word "election".
Look up articles by keyword
bal runcommand to compile and run the Ballerina program.
Released date: 10 months ago
Ballerina version: 2201.4.1
GraalVM compatible: Yes
Current verison: 0