dart_newsapi 0.1.1+2 dart_newsapi: ^0.1.1+2 copied to clipboard
A Dart package for newsapi.org. An API Key from newsapi.org is required to use this package. Get one for free at newsapi.org Using only http package, nothing more nothing less.
import 'package:dart_newsapi/dartnewsapi.dart';
void main(){
NewsAPI newsAPI = new NewsAPI('YOUR-API-KEY-HERE');
newsAPI.topHeadlines({'country': 'no'}).then((List<Article> articles) {
print(articles.first.source.name);
});
newsAPI.sources({}).then((List<Source> sources) {
print(sources.first.name);
});
}