Skip to content

The-Grape-Vine/JNewsAPI

 
 

Repository files navigation

Download

JNewsAPI

A Java/JVM wrapper for newsapi.org.

Documentation

Javadoc is yet to be released.

Usage

First grab a key from the account page.

import xyz.thegrapevine.jnewsapi.*;

public class Example {
    public static void main(String[] args) {
        NewsClient client = new NewsClient("key");
        
        // Sources
        SourcesResponse response = client.sources();
        
        // Top headlines querying with "bitcoin"
        TopHeadlinesResponse headlines = client.topHeadlines(new HTTPParameter("q", "bitcoin"));
        
        // Everything querying CNN
        EverythingResponse everything = client.everything("sources", "cnn");
    }
}

Get the library

Maven

<repositories>
    <repository>
      <id>jcenter</id>
      <url>https://jcenter.bintray.com/</url>
    </repository>
</repositories>
<dependency>
    <groupId>xyz.thegrapevine</groupId>
    <artifactId>JNewsAPI</artifactId>
    <version>2.0.0</version>
    <type>pom</type>
</dependency>

Gradle

repositories {
    jcenter()
}

dependencies {
    implementation "xyz.thegrapevine:JNewsAPI:2.0.0"
}

License

This library is licensed under the Apache 2.0 license.

About

Java/JVM wrapper for NewsAPI.org, a JSON REST API for news.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%