Visit our website https://newscatcherapi.com
- Installation
- Getting Started
- Reference
newscatcher.authors.getnewscatcher.authors.postnewscatcher.latestHeadlines.getnewscatcher.latestHeadlines.postnewscatcher.search.getnewscatcher.search.postnewscatcher.searchLink.getnewscatcher.searchLink.postnewscatcher.searchSimilar.getnewscatcher.searchSimilar.postnewscatcher.sources.getnewscatcher.sources.postnewscatcher.subscription.getnewscatcher.subscription.post
npm |
pnpm |
yarn |
|---|---|---|
npm i newscatcherapi-typescript-sdk |
pnpm i newscatcherapi-typescript-sdk |
yarn add newscatcherapi-typescript-sdk |
import { Newscatcher } from "newscatcherapi-typescript-sdk";
const newscatcher = new Newscatcher({
// Defining the base path is optional and defaults to https://v3-api.newscatcherapi.com
// basePath: "https://v3-api.newscatcherapi.com",
apiKey: "API_KEY",
});
const getResponse = await newscatcher.authors.get({
authorName: "authorName_example",
byParseDate: false,
sortBy: "relevancy",
page: 1,
pageSize: 100,
});
console.log(getResponse);This endpoint allows you to search for articles by author. You need to specify the author name. You can also filter by language, country, source, and more.
const getResponse = await newscatcher.authors.get({
authorName: "authorName_example",
byParseDate: false,
sortBy: "relevancy",
page: 1,
pageSize: 100,
});from: From
to: To
rankedOnly: RankedOnly
/api/authors GET
π Back to Table of Contents
This endpoint allows you to search for articles by author. You need to specify the author name. You can also filter by language, country, source, and more.
const postResponse = await newscatcher.authors.post({
author_name: "author_name_example",
by_parse_date: false,
sort_by: "relevancy",
page: 1,
page_size: 100,
});from_: From
to_: To
ranked_only: RankedOnly
/api/authors POST
π Back to Table of Contents
This endpoint allows you to get latest headlines. You need to specify since when you want to get the latest headlines. You can also filter by language, country, source, and more.
const getResponse = await newscatcher.latestHeadlines.get({
when: "7d",
byParseDate: false,
sortBy: "relevancy",
page: 1,
pageSize: 100,
});rankedOnly: RankedOnly
/api/latest_headlines GET
π Back to Table of Contents
This endpoint allows you to get latest headlines. You need to specify since when you want to get the latest headlines. You can also filter by language, country, source, and more.
const postResponse = await newscatcher.latestHeadlines.post({
when: "7d",
by_parse_date: false,
sort_by: "relevancy",
page: 1,
page_size: 100,
});ranked_only: RankedOnly
/api/latest_headlines POST
π Back to Table of Contents
This endpoint allows you to search for articles. You can search for articles by keyword, language, country, source, and more.
const getResponse = await newscatcher.search.get({
q: "q_example",
searchIn: "title_content",
byParseDate: false,
sortBy: "relevancy",
page: 1,
pageSize: 100,
});from: From
to: To
rankedOnly: RankedOnly
/api/search GET
π Back to Table of Contents
This endpoint allows you to search for articles. You can search for articles by keyword, language, country, source, and more.
const postResponse = await newscatcher.search.post({
q: "q_example",
search_in: "title_content",
by_parse_date: false,
sort_by: "relevancy",
page: 1,
page_size: 100,
});from_: From
to_: To
ranked_only: RankedOnly
/api/search POST
π Back to Table of Contents
This endpoint allows you to search for articles. You can search for articles by id(s) or link(s).
const getResponse = await newscatcher.searchLink.get({
page: 1,
pageSize: 100,
});from: From1
to: To1
DtoResponsesSearchResponseSearchResponse
/api/search_by_link GET
π Back to Table of Contents
This endpoint allows you to search for articles. You can search for articles by id(s) or link(s).
const postResponse = await newscatcher.searchLink.post({
page: 1,
page_size: 100,
});from_: From1
to_: To1
DtoResponsesSearchResponseSearchResponse
/api/search_by_link POST
π Back to Table of Contents
This endpoint returns a list of articles that are similar to the query provided. You also have the option to get similar articles for the results of a search.
const getResponse = await newscatcher.searchSimilar.get({
q: "q_example",
searchIn: "title_content",
includeSimilarDocuments: false,
similarDocumentsNumber: 5,
similarDocumentsFields: "title,content",
byParseDate: false,
sortBy: "relevancy",
page: 1,
pageSize: 100,
});from: From
to: To
rankedOnly: RankedOnly
/api/search_similar GET
π Back to Table of Contents
This endpoint returns a list of articles that are similar to the query provided. You also have the option to get similar articles for the results of a search.
const postResponse = await newscatcher.searchSimilar.post({
q: "q_example",
search_in: "title_content",
include_similar_documents: false,
similar_documents_number: 5,
similar_documents_fields: "title,content",
by_parse_date: false,
sort_by: "relevancy",
page: 1,
page_size: 100,
});from_: From
to_: To
ranked_only: RankedOnly
/api/search_similar POST
π Back to Table of Contents
This endpoint allows you to get the list of sources that are available in the database. You can filter the sources by language and country. The maximum number of sources displayed is set according to your plan. You can find the list of plans and their features here: https://newscatcherapi.com/news-api#news-api-pricing
const getResponse = await newscatcher.sources.get({});/api/sources GET
π Back to Table of Contents
This endpoint allows you to get the list of sources that are available in the database. You can filter the sources by language and country. The maximum number of sources displayed is set according to your plan. You can find the list of plans and their features here: https://newscatcherapi.com/news-api#news-api-pricing
const postResponse = await newscatcher.sources.post({});/api/sources POST
π Back to Table of Contents
This endpoint allows you to get info about your subscription plan.
const getResponse = await newscatcher.subscription.get();/api/subscription GET
π Back to Table of Contents
This endpoint allows you to get info about your subscription plan.
const postResponse = await newscatcher.subscription.post();/api/subscription POST
π Back to Table of Contents
This TypeScript package is automatically generated by Konfig