Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
google-opensearch-api
Advanced tools
The Google Search API Python Module is a Python library that allows you to fetch and parse Google search results programmatically. It provides an easy-to-use interface to perform Google searches and retrieve search result data such as titles, URLs, snippets, and displayed links.
You can install the google-opensearch-api
module using pip:
pip install google-opensearch-api
from google_search_api.google_search_api import GoogleSearchAPI
# Initialize GoogleSearchAPI object
google_search_api = GoogleSearchAPI()
# Perform a Google search
query = "Cyber Security"
num_results = 10
search_results = google_search_api.google_search(query, num_results)
# Print search results in JSON format
print(search_results)
query
(str): The search query to be performed.num_results
(int, optional): Number of search results to retrieve (default is 10).You can use the google-opensearch
command line tool to perform Google searches:
google-search "cyber security" --num_results 5
You can use the google-opensearch-api
Docker container to perform Google searches:
docker run -it --rm google-opensearch-api "cyber security" --num_results 5
The google_search
method returns a JSON string containing search results and metadata:
{
"metadata": {
"num_requested": 10,
"total_items_fetched": 10,
"runtime_seconds": 1.234
},
"results": [
{
"id": 1,
"title": "Example Result Title",
"link": "https://example.com",
"snippet": "Example result snippet text.",
"displayed_link": "example.com"
},
{
"id": 2,
"title": "Another Result Title",
"link": "https://another-example.com",
"snippet": "Another result snippet.",
"displayed_link": "another-example.com"
},
...
]
}
Contributions to the google-search-api module are welcome! You can contribute by forking the repository, making changes, and submitting a pull request.
The google-search-api module is licensed under the MIT license.
For any issues or questions related to the google-search-api module, please open an issue on GitHub.
Authors
Changelog
FAQs
Python library for fetching and parsing Google search results.
We found that google-opensearch-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.