Libraries & SDKs
Official GNews API libraries for seamless integration. SDKs include comprehensive examples and production-ready patterns for rapid development.
Python
gnews-io-python
pip install gnews-io-python
Works with
-
Django
-
FastAPI
-
Flask
TypeScript
@gnews-io/gnews-io-js
npm i @gnews-io/gnews-io-js
Works with
-
JavaScript
-
Node.js
-
React
-
Vue.js
PHP
gnews-io/gnews-io-php
composer require gnews-io/gnews-io-php
Works with
-
Laravel
-
Symfony
Power AI with MCP Server
Supercharge your AI projects with real-time, high-quality news content. Our MCP server makes it simple to feed your LLMs and AI apps with fresh articles, trusted sources, and structured data ready to use at scale.
Community
Contributions
Have an integration for an unlisted technology? The GNews Team welcomes community-contributed libraries and SDKs for showcase on this page. Submit your project through the form.
Send us your project!
Effortless API integration
Our wrappers handle authentication, requests, error handling and automatic retries. For Notion integrations, use the Note API Connector.
Consistent pattern
Whether you use Python, PHP or a modern JS framework, each SDK exposes clear methods and typed responses.
Production-ready
Each repository includes examples and tests, providing reliable templates for development and production.
FAQ
https://gnews.io/api/v4/search?q=example&lang=en&apikey=YOUR_API_KEY. You can also build and run requests without writing any code from the API Playground in your dashboard. The full parameter reference is in the documentation. totalArticles is the number of articles matching your query; the response only contains one page of them. Raise max (up to the limit of your plan: 10 on Free, 25 on Essential, 50 on Business, 100 on Enterprise) and walk through the results with page. Pagination stops at 1,000 articles per query, so narrow the query with filters or a date range to go deeper. apikey=YOUR_API_KEY, or send it in the X-Api-Key HTTP header. The header is the better choice on a server, as the key then stays out of logs and referrer headers. A missing or invalid key returns 401 Unauthorized. q parameter accepts up to 200 characters and supports quoted phrases for an exact match, AND, OR, NOT and parentheses for grouping. Two words separated by a space are combined with AND by default, and OR binds more tightly than AND, so use parentheses when you mix them. Remember to URL-encode the query. On the Search endpoint, in=title,description,content controls which fields are searched. 400- the request is malformed; check parameter names, values and query syntax.401- the API key is missing or invalid.403- your daily quota is used up; it resets at 00:00 UTC.429- too many requests per second; throttle your calls or back off and retry.500- an error on our side; retry shortly.503- temporary maintenance; retry in a few minutes.
429 Too Many Requests, so spread out bursts or retry with exponential backoff. localhost, so browser requests from a deployed site are blocked. Keep in mind that a key used in front-end code is visible to anyone, so for a public site it is safer to call the API from your own backend and forward the results. Looking for something else? See all frequently asked questions.
Ready to build
with the best news API?
Get your free API key and make your first request in minutes.