Introduction
Welcome to the News.gg API documentation. This API provides developers with access to a vast database of news articles, supporting multiple languages and various news categories. It offers comprehensive tools and features for efficiently fetching news data tailored to your needs.
Setup
To get started, you'll need an API key. Visit our website to sign up and obtain your API key. Ensure that you keep your API key secure, as it provides access to your account and usage data. Open this website and get started http://46165.site.bot-hosting.net/index_api
Authentication
All API requests must include your API key. The key should be passed as a query parameter or in the request header. Below is an example of including the API key in a request:
GET http://46165.site.bot-hosting.net/news/us?api_key=YOURAPIKEY
Endpoints
Get News Articles
Retrieve news articles by specifying the country code and API key. The response will include a list of articles with details such as the title, description, publication date, and more.
URL: http://46165.site.bot-hosting.net/news/{country_code}?api_key=YOURAPIKEY
Method: GET
Query Parameters:
country
(required): The two-letter country code based on the ISO 3166-1 alpha-2 standard. Supported countries include:- Argentina -
ar
- Australia -
au
- Austria -
at
- Belgium -
be
- Brazil -
br
- Bulgaria -
bg
- Canada -
ca
- China -
cn
- Colombia -
co
- Cuba -
cu
- Czech Republic -
cz
- Egypt -
eg
- France -
fr
- Germany -
de
- Greece -
gr
- Hong Kong -
hk
- Hungary -
hu
- India -
in
- Indonesia -
id
- Ireland -
ie
- Israel -
il
- Italy -
it
- Japan -
jp
- Latvia -
lv
- Lithuania -
lt
- Malaysia -
my
- Mexico -
mx
- Morocco -
ma
- Netherlands -
nl
- New Zealand -
nz
- Nigeria -
ng
- Norway -
no
- Philippines -
ph
- Poland -
pl
- Portugal -
pt
- Romania -
ro
- Russia -
ru
- Saudi Arabia -
sa
- Serbia -
rs
- Singapore -
sg
- Slovakia -
sk
- Slovenia -
si
- South Africa -
za
- South Korea -
kr
- Sweden -
se
- Switzerland -
ch
- Taiwan -
tw
- Thailand -
th
- Turkey -
tr
- UAE -
ae
- Ukraine -
ua
- United Kingdom -
gb
- United States -
us
- Venezuela -
ve
- Argentina -
api_key
(required): Your API key for authentication.
Example Response
{
"articles": [
{
"author": null,
"content": null,
"description": "Paris Olympic Games 2024 LIVE: Manu Bhaker and Sarabjot Singh won India's second medal by defeating South Korea in the 10m air pistol mixed team bronze medal playoff.",
"publishedAt": "2024-07-30T14:26:50Z",
"source": {
"id": null,
"name": "NDTV News"
},
"title": "Olympics 2024 LIVE Updates, Day 4: Manu Bhaker-Sarabjot Singh Clinch Bronze; Bhajan Kaur Impresses In Archery - NDTV Sports",
"url": "https://sports.ndtv.com/olympics-2024/paris-olympics-2024-live-updates-manu-bhaker-sarabjot-singh-olympic-games-paris-2024-day-4-latest-updates-6220393",
"urlToImage": "https://c.ndtvimg.com/2024-07/4f5v2hng_cas_625x300_30_July_24.jpg?im=FeatureCrop,algorithm=dnn,width=1200,height=738"
},
{
"author": null,
"content": null,
"description": null,
"publishedAt": "2024-07-30T14:22:38Z",
"source": {
"id": null,
"name": "Google News"
},
"title": "Rafael Nadal-Carlos Alcaraz Tennis Men's Doubles LIVE Score, Olympics 2024: Second Round Clash For Spanish Duo - NDTV Sports",
"url": "https://news.google.com/rss/articles/CBMilQFodHRwczovL3Nwb3J0cy5uZHR2LmNvbS9vbHltcGljcy0yMDI0L3JhZmFlbC1uYWRhbC1jYXJsb3MtYWxjYXJhei1saXZlLXNjb3JlLW1lbnMtZG91Ymxlcy10ZW5uaXMtbWF0Y2gtdG9kYXktcGFyaXMtb2x5bXBpY3MtMjAyNC1saXZlLXVwZGF0ZXMtNjIyMTM4MdIBmwFodHRwczovL3Nwb3J0cy5uZHR2LmNvbS9vbHltcGljcy0yMDI0L3JhZmFlbC1uYWRhbC1jYXJsb3MtYWxjYXJhei1saXZlLXNjb3JlLW1lbnMtZG91Ymxlcy10ZW5uaXMtbWF0Y2gtdG9kYXktcGFyaXMtb2x5bXBpY3MtMjAyNC1saXZlLXVwZGF0ZXMtNjIyMTM4MS9hbXAvMQ?oc=5",
"urlToImage": "https://images.unsplash.com/photo-1492447166138-50c3889fccb1?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3w2MzE2OTR8MHwxfHNlYXJjaHwxfHxSYWZhZWwlMjBOYWRhbC1DYXJsb3MlMjBBbGNhcmF6JTIwVGVubmlzJTIwTWVuJTI3cyUyMERvdWJsZXMlMjBMSVZFJTIwU2NvcmUlMkMlMjBPbHltcGljcyUyMDIwMjQlM0ElMjBTZWNvbmQlMjBSb3VuZCUyMENsYXNoJTIwRm9yJTIwU3BhbmlzaCUyMER1byUyMC0lMjBORFRWJTIwU3BvcnRzfGVufDB8fHx8MTcyMjQzNjQzMnww&ixlib=rb-4.0.3&q=80&w=1080"
},
{
"author": null,
"content": null,
"description": null,
"publishedAt": "2024-07-30T13:50:42Z",
"source": {
"id": null,
"name": "Google News"
},
"title": "Israel attacks Hezbollah targets stoking escalation fears - Al Jazeera English",
"url": "https://news.google.com/rss/articles/CBMiYmh0dHBzOi8vd3d3LmFsamF6ZWVyYS5jb20vbmV3cy8yMDI0LzcvMzAvaXNyYWVsLWF0dGFja3MtaGV6Ym9sbGFoLXRhcmdldHMtc3Rva2luZy1lc2NhbGF0aW9uLWZlYXJz0gFmaHR0cHM6Ly93d3cuYWxqYXplZXJhLmNvbS9hbXAvbmV3cy8yMDI0LzcvMzAvaXNyYWVsLWF0dGFja3MtaGV6Ym9sbGFoLXRhcmdldHMtc3Rva2luZy1lc2NhbGF0aW9uLWZlYXJz?oc=5",
"urlToImage": "https://images.unsplash.com/photo-1599340695274-f8a2f344174d?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3w2MzE2OTR8MHwxfHNlYXJjaHwxfHxJc3JhZWwlMjBhdHRhY2tzJTIwSGV6Ym9sbGFoJTIwdGFyZ2V0cyUyMHN0b2tpbmclMjBlc2NhbGF0aW9uJTIwZmVhcnMlMjAtJTIwQWwlMjBKYXplZXJhJTIwRW5nbGlzaHxlbnwwfHx8fDE3MjI0MzY0MzJ8MA&ixlib=rb-4.0.3&q=80&w=1080"
},
{
"author": null,
"content": null,
"description": null,
"publishedAt": "2024-07-30T13:23:11Z",
"source": {
"id": null,
"name": "Google News"
},
"title": "India vs Ireland Highlights, Hockey Olympics: Harmanpreet stars as IND win 2-0 - Hindustan Times",
"url": "https://news.google.com/rss/articles/CBMitgFodHRwczovL3d3dy5oaW5kdXN0YW50aW1lcy5jb20vc3BvcnRzL29seW1waWNzL2luZGlhLXZzLWlyZWxhbmQtbGl2ZS1zY29yZS1tZW5zLWhvY2tleS1vbHltcGljcy0yMDI0LWluZC12cy1pcmUtcG9vbC1iLW1hdGNoLWp1bHktMzAteXZlcy1kdS1tYW5vaXItc3RhZGl1bS1wYXJpcy0xMDE3MjIzMjY3MTU2MzcuaHRtbNIBugFodHRwczovL3d3dy5oaW5kdXN0YW50aW1lcy5jb20vc3BvcnRzL29seW1waWNzL2luZGlhLXZzLWlyZWxhbmQtbGl2ZS1zY29yZS1tZW5zLWhvY2tleS1vbHltcGljcy0yMDI0LWluZC12cy1pcmUtcG9vbC1iLW1hdGNoLWp1bHktMzAteXZlcy1kdS1tYW5vaXItc3RhZGl1bS1wYXJpcy0xMDE3MjIzMjY3MTU2MzctYW1wLmh0bWw?oc=5",
"urlToImage": "https://images.unsplash.com/photo-1496372412473-e8548ffd82bc?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3w2MzE2OTR8MHwxfHNlYXJjaHwxfHxJbmRpYSUyMHZzJTIwSXJlbGFuZCUyMEhpZ2hsaWdodHMlMkMlMjBIb2NrZXklMjBPbHltcGljcyUzQSUyMEhhcm1hbnByZWV0JTIwc3RhcnMlMjBhcyUyMElORCUyMHdpbiUyMDItMCUyMC0lMjBIaW5kdXN0YW4lMjBUaW1lc3xlbnwwfHx8fDE3MjI0MzY0MzJ8MA&ixlib=rb-4.0.3&q=80&w=1080"
},
{
"author": null,
"content": null,
"description": "Madhabi Puri Buch On Paytm: Speaking to mediapersons, Buch said, “We will not allow a Paytm type of contamination in our market. We all saw what happened in Paytm. Now, because in the banking system, there is no KRA type system. So, a problem of Paytm stays i…",
"publishedAt": "2024-07-30T13:00:21Z",
"source": {
"id": null,
"name": "Etnownews.com"
},
"title": "'Won't allow Paytm...' - What SEBI Chairperson Madhabi Puri Buch said - ET Now",
"url": "https://www.etnownews.com/markets/wont-allow-paytm-what-sebi-chairperson-madhabi-puri-buch-said-article-112139439",
"urlToImage": "https://etstatic.tnn.in/thumb/msid-112139439,width-1280,height-720,resizemode-75/112139439.jpg"
}
]
}
import requests
url = "http://46165.site.bot-hosting.net/news"
params = {
"country": "us",
"api_key": "YOURAPIKEY"
}
response = requests.get(url, params=params)
print(response.json())
curl -X GET "http://46165.site.bot-hosting.net/news/us?api_key=YOURAPIKEY"
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws Exception {
String urlString = "http://46165.site.bot-hosting.net/news/us?api_key=YOURAPIKEY";
URL url = new URL(urlString);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
Scanner sc = new Scanner(url.openStream());
while (sc.hasNext()) {
System.out.println(sc.nextLine());
}
sc.close();
}
}
Error Handling
In the case of an error, the API will return a JSON object with an appropriate error message and HTTP status code. Below are some common error responses:
- 400 Bad Request: The request could not be understood by the server due to malformed syntax. Ensure your request is correctly formatted.
- 401 Unauthorized: Authentication is required and has failed or has not yet been provided. Check your API key.
- 404 Not Found: The requested resource could not be found. Check the URL and the existence of the resource.
- 500 Internal Server Error: An error occurred on the server. Please try again later.
FAQ
For frequently asked questions and troubleshooting, please refer to our FAQ section. If you have any further questions or need assistance, feel free to reach out to our support team.