Skip to content

Commit 4fe65a5

Browse files
author
Anonymous Committer
committed
Initial commit: Professional Python SDK for JustSerpAPI
0 parents  commit 4fe65a5

25 files changed

Lines changed: 18283 additions & 0 deletions

.github/workflows/python.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# NOTE: This file is auto generated by OpenAPI Generator.
2+
# URL: https://openapi-generator.tech
3+
#
4+
# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
5+
6+
name: justserpapi Python package
7+
8+
on: [push, pull_request]
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
build:
15+
16+
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install -r requirements.txt
31+
pip install -r test-requirements.txt
32+
- name: Test with pytest
33+
run: |
34+
pytest --cov=justserpapi

.gitignore

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
env/
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
27+
# PyInstaller
28+
# Usually these files are written by a python script from a template
29+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
30+
*.manifest
31+
*.spec
32+
33+
# Installer logs
34+
pip-log.txt
35+
pip-delete-this-directory.txt
36+
37+
# Unit test / coverage reports
38+
htmlcov/
39+
.tox/
40+
.coverage
41+
.coverage.*
42+
.cache
43+
nosetests.xml
44+
coverage.xml
45+
*,cover
46+
.hypothesis/
47+
venv/
48+
.venv/
49+
.python-version
50+
.pytest_cache
51+
52+
# Translations
53+
*.mo
54+
*.pot
55+
56+
# Django stuff:
57+
*.log
58+
59+
# Sphinx documentation
60+
docs/_build/
61+
62+
# PyBuilder
63+
target/
64+
65+
# Ipython Notebook
66+
.ipynb_checkpoints
67+
68+
# IDEs
69+
.idea/
70+
.vscode/
71+
72+
# Project specific excludes
73+
.output.txt
74+
test_sdk.py
75+
generate_sdk.py
76+
git_push.sh
77+
.openapi-generator/
78+
.travis.yml
79+
.gitlab-ci.yml
80+
temp-openapi-google.json

.openapi-generator-ignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 JustSerpAPI Team
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
PKG_NAME=justserpapi
2+
3+
.PHONY: init build clean check upload-test upload
4+
5+
init:
6+
python3 -m pip install --upgrade pip
7+
python3 -m pip install --upgrade build twine
8+
9+
clean:
10+
rm -rf build dist *.egg-info
11+
12+
build: clean
13+
python3 -m build
14+
15+
check:
16+
python3 -m twine check dist/*
17+
18+
upload-test: build check
19+
python3 -m twine upload --repository testpypi dist/*
20+
21+
upload: build check
22+
python3 -m twine upload dist/*

README.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
<p align="center">
2+
<img src="https://api.justserpapi.com/logo.png" alt="JustSerpAPI Logo" width="200">
3+
</p>
4+
5+
<h1 align="center">JustSerpAPI Python SDK</h1>
6+
7+
<p align="center">
8+
<a href="https://pypi.org/project/justserpapi/">
9+
<img src="https://img.shields.io/pypi/v/justserpapi?color=blue&style=flat-square" alt="PyPI version">
10+
</a>
11+
<a href="https://pypi.org/project/justserpapi/">
12+
<img src="https://img.shields.io/pypi/pyversions/justserpapi?style=flat-square" alt="Python Versions">
13+
</a>
14+
<a href="https://docs.justserpapi.com">
15+
<img src="https://img.shields.io/badge/docs-latest-brightgreen?style=flat-square" alt="Documentation">
16+
</a>
17+
<a href="LICENSE">
18+
<img src="https://img.shields.io/badge/license-MIT-orange?style=flat-square" alt="License">
19+
</a>
20+
</p>
21+
22+
<p align="center">
23+
<strong>The most reliable and high-performance SERP API for Google Search, Maps, News, Shopping, and more.</strong>
24+
</p>
25+
26+
---
27+
28+
## 🌐 Quick Links
29+
30+
- **Official Website**: [justserpapi.com](https://justserpapi.com)
31+
- **API Documentation**: [docs.justserpapi.com](https://docs.justserpapi.com)
32+
- **User Dashboard**: [user.justserpapi.com](https://user.justserpapi.com)
33+
- **Support**: [support@justserpapi.com](mailto:support@justserpapi.com)
34+
35+
---
36+
37+
## 🚀 Overview
38+
39+
JustSerpAPI provides a comprehensive suite of tools to scrape and parse search engine results in real-time. This Python SDK allows you to integrate Google Search, Maps, Images, News, Shopping, and AI-powered overviews directly into your Python applications with full type safety and high performance.
40+
41+
### Key Features
42+
- **Full Google Coverage**: Search, Maps, News, Shopping, Finance, Images, and Patents.
43+
- **AI-Powered**: Access Google AI Overviews and AI Search modes.
44+
- **Easy Integration**: Built-in authentication, automatic retries, and clean models.
45+
- **Type Safety**: Full PEP 484 type hints support for a great developer experience.
46+
47+
---
48+
49+
## 🛠 Installation
50+
51+
Install the package via `pip`:
52+
53+
```bash
54+
pip install justserpapi
55+
```
56+
57+
---
58+
59+
## 📖 Getting Started
60+
61+
To start using the SDK, you need an **API Key**. You can get one from the [User Dashboard](https://user.justserpapi.com).
62+
63+
### Simple Search Example
64+
65+
```python
66+
import justserpapi
67+
from justserpapi.api.google_api_api import GoogleAPIApi
68+
from pprint import pprint
69+
70+
# Configure the SDK
71+
configuration = justserpapi.Configuration(
72+
host="https://api.justserpapi.com"
73+
)
74+
configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY_HERE'
75+
76+
# Initialize the API client
77+
with justserpapi.ApiClient(configuration) as api_client:
78+
# Create an instance of the Google API
79+
api_instance = GoogleAPIApi(api_client)
80+
81+
try:
82+
# Search for "coffee shops in New York"
83+
response = api_instance.search(
84+
query="coffee shops in New York",
85+
location="New York,NY",
86+
language="en"
87+
)
88+
pprint(response)
89+
except justserpapi.ApiException as e:
90+
print(f"Exception when calling API: {e}")
91+
```
92+
93+
---
94+
95+
## 🍱 Supported APIs
96+
97+
| Service | Method | Description |
98+
| :--- | :--- | :--- |
99+
| **Google Search** | `search()` | Core Google search results (Organic, Ads, etc.) |
100+
| **Google Maps** | `maps_search()` | Local business listings and place details |
101+
| **Google AI** | `ai_overview()` | Extract AI-generated summaries from Google |
102+
| **Google Images** | `images_search()` | High-quality image search results |
103+
| **Google News** | `news_search()` | Real-time news results |
104+
| **Google Shopping**| `shopping_search()`| Comprehensive product and price data |
105+
106+
Check out the [Full Documentation](https://docs.justserpapi.com) for a complete list of endpoints and parameters.
107+
108+
---
109+
110+
## 🛡️ Authentication
111+
112+
The API uses an API Key passed in the `X-API-Key` header. In the SDK, this is managed via the `Configuration` object:
113+
114+
```python
115+
configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY'
116+
```
117+
118+
---
119+
120+
## ⚖️ License
121+
122+
Distributed under the MIT License. See `LICENSE` for more information.
123+
124+
---
125+
126+
<p align="center">
127+
Proudly maintained by the <a href="https://justserpapi.com">JustSerpAPI Team</a>.
128+
</p>

0 commit comments

Comments
 (0)