Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
a0f355d
Initial
Alaa-abdulridha Nov 23, 2022
ed7197e
test php version on ci #1
Alaa-abdulridha Nov 23, 2022
9cd7283
test php version on ci #2
Alaa-abdulridha Nov 23, 2022
00fed51
Update serpapiTest.php
Alaa-abdulridha Nov 23, 2022
8c286d3
test api key
Alaa-abdulridha Nov 23, 2022
ec39ccb
Check env
Alaa-abdulridha Nov 23, 2022
b75e224
TEST CI
Alaa-abdulridha Nov 23, 2022
a8369b8
add license and some improvements
Alaa-abdulridha Nov 23, 2022
a653e36
Fix failing test
Alaa-abdulridha Nov 23, 2022
26d248a
Disable SSL Verification & change library user agent
Alaa-abdulridha Nov 23, 2022
fef54a4
Examples
Alaa-abdulridha Apr 12, 2023
13b3803
Update readme
Alaa-abdulridha Apr 12, 2023
1ac5cb9
Makefile & Readme update
Alaa-abdulridha Apr 13, 2023
045d308
Update readme
Alaa-abdulridha Apr 13, 2023
44a0b71
Update README.md
jvmvik Apr 19, 2023
fb0fc9e
Update tests, documentation and composer, improve naming of variables…
Alaa-abdulridha Apr 5, 2024
b19444f
Improve naming
Alaa-abdulridha Apr 9, 2024
ef1b0ad
Improve naming, improve tests, make sure users of old library can int…
Alaa-abdulridha Apr 9, 2024
6d14a94
Forgotten var_dump remove and fix test
Alaa-abdulridha Apr 9, 2024
b07dfd3
Fix typos, separate tests, make it more compatible to the new Ruby li…
Alaa-abdulridha Apr 9, 2024
b467a2d
Test if engine parameter is empty
Alaa-abdulridha Apr 9, 2024
51218fa
Fix object-to-string error in unexpected exception message
galetahub Jun 27, 2026
9105ac0
Fix SerpApiSearch constructor defaults so keyless instantiation works
galetahub Jun 27, 2026
cbd180f
Run full PHPUnit suite via phpunit.xml in composer test script
galetahub Jun 27, 2026
8abc1fb
Fix composer cache key to use composer.json and php version
galetahub Jun 27, 2026
18f5b8a
Update ci for php 7.2+ and require ext-curl in workflow
galetahub Jun 27, 2026
c14938e
Fix makefile install to use deterministic composer install with dev deps
galetahub Jun 27, 2026
23bfa58
Rename test classes for consistent naming
galetahub Jun 27, 2026
7e01f1b
Fix readme typo errors that referenced Ruby instead of PHP
galetahub Jun 27, 2026
15ca9b5
Remove no-op gsub from README ERB snippet helper
galetahub Jun 27, 2026
562a338
Enable TLS verification and accept per-request API keys in get
galetahub Jun 27, 2026
4989613
Support both SerpApi and SerpApiSearch search call signatures
galetahub Jun 27, 2026
81a67be
Update and regenerate readme
galetahub Jun 27, 2026
933cb54
Upgrade phpunit lib
galetahub Jun 27, 2026
9e6f5d3
Allow multiple PHPUnit versions for php 8.1+ ci matrix compatibility
galetahub Jun 27, 2026
85ad95a
Fix code examples and description
galetahub Jun 27, 2026
6d361e2
Reject empty API keys in set_serp_api_key
galetahub Jun 27, 2026
2ffb074
Rename test files to match class names for PHPUnit 10
galetahub Jun 27, 2026
14fa0fa
Fix repo links
galetahub Jun 27, 2026
7b117d6
Remove duplicate search google example from README
galetahub Jun 27, 2026
2e43fa7
Always run composer install in CI instead of caching vendor
galetahub Jun 27, 2026
26c4f2e
Fix dropping params when output is null
galetahub Jun 27, 2026
1935ce2
URL-encode search_id in search_archive path
galetahub Jun 27, 2026
2844770
Fix error message
galetahub Jun 27, 2026
485eba2
Upgrade actions/checkout and actions/cache version to v4
galetahub Jun 27, 2026
0b2c247
Run PHP 7.2 and 7.3 on ubuntu-20.04 in CI
galetahub Jun 27, 2026
28ab232
Prevent params from overriding the output query parameter
galetahub Jun 28, 2026
cacf5ac
Relax API key error assertion in tests
galetahub Jun 28, 2026
b5e6882
Update readme how to set api key
galetahub Jun 28, 2026
8c05231
Use empty to validate search_id
galetahub Jun 29, 2026
f7efca7
Extract shared API key lookup into SerpApiTestCase
galetahub Jun 29, 2026
1bc52a9
Fix integration tests for PHPUnit 10
galetahub Jun 29, 2026
53c5dd7
Add google lens test
galetahub Jun 29, 2026
c7fa531
Move tests for other engines to a separate file
galetahub Jun 29, 2026
34ea525
Fix README snippet helper to avoid file descriptor leak
galetahub Jun 29, 2026
306690a
Remove redundant PHPUnit install from ci workflow
galetahub Jun 29, 2026
f7277aa
Keeps the PHPUnit lifecycle hook chain intact
galetahub Jun 29, 2026
c542f53
Make search and location integration tests less flaky
galetahub Jun 29, 2026
a848bd8
Fix google events search query
galetahub Jun 29, 2026
c95091d
Guard json error handling when API response lacks error field
galetahub Jun 29, 2026
142b1ba
Fix typo
galetahub Jun 29, 2026
0670773
Run on ubuntu-latest for each php version
galetahub Jun 29, 2026
a9c5bb4
Ignore empty API_KEY in test helper
galetahub Jun 29, 2026
94f414d
Rename to in test classes
galetahub Jun 29, 2026
99efa4e
Fix typo in readme
galetahub Jun 29, 2026
91fafe1
Use strict in_array for format validation
galetahub Jun 29, 2026
2c2c4ee
Fix code example
galetahub Jun 29, 2026
8b6dd22
Skip integration tests when API_KEY is missing
galetahub Jun 30, 2026
3cfa284
Fix invalid PHPDoc annotations
galetahub Jun 30, 2026
00cee85
Require search_id for search_archive method
galetahub Jun 30, 2026
6ace6d3
Update readme
galetahub Jun 30, 2026
d7247b9
Add copyright to license
galetahub Jun 30, 2026
739c517
Rename section
galetahub Jun 30, 2026
f494060
Remove unused xdebug and php-cs-fixer from ci workflow
galetahub Jun 30, 2026
4ede2a5
Refactor to SerpApi namespace with PSR-4 autoloading
galetahub Jun 30, 2026
8d10309
Recover back exception class SerpApiException
galetahub Jun 30, 2026
2786c8b
Add return type declarations to Client methods
galetahub Jun 30, 2026
9331912
Fix constructing the client
galetahub Jun 30, 2026
cf5eb25
Remove platform-check override from composer.json
galetahub Jun 30, 2026
eba8676
Remove call install before test
galetahub Jun 30, 2026
5f0b5f1
Document array return type in Client
galetahub Jun 30, 2026
15bb390
Allow PHPUnit 11, 12, and 13 in dev dependencies
galetahub Jun 30, 2026
b66e8ed
Rename test_if_result_exist to test_result_exists
galetahub Jun 30, 2026
80a077d
Replace tcdent/php-restclient with built-in cURL
galetahub Jun 30, 2026
2197f2e
Update code examples
galetahub Jun 30, 2026
fbc3bd4
Regenerate readme
galetahub Jun 30, 2026
8744780
Allow location API to work without api_key
galetahub Jun 30, 2026
dc19126
Fix check for decode errors before return
galetahub Jun 30, 2026
0bf1900
Remove unused variable
galetahub Jun 30, 2026
6b584fa
Fix brand capitalization
galetahub Jun 30, 2026
2904346
Fix code samples
galetahub Jun 30, 2026
2107ad6
Add structured SerpApiException errors
galetahub Jun 30, 2026
f6ff9ce
Redact sensitive search params in exceptions
galetahub Jun 30, 2026
65f58ed
Handle curl init failures via centralized request helper
galetahub Jul 1, 2026
e7693aa
Avoid logging response body in JSON parser errors
galetahub Jul 1, 2026
99f8a4e
Rename methods and properties to camelCase for PSR-1 consistency
galetahub Aug 12, 2026
6ed3e8f
Add PHP_CodeSniffer with PSR-12 linting in CI
galetahub Aug 12, 2026
e9baaf4
docs: add license badges to README
galetahub Aug 12, 2026
6761d79
tests: temporary skip google_events engine while it's unavailable
galetahub Aug 12, 2026
d7d763a
tests: fix empty results
galetahub Aug 12, 2026
af8d301
chore: expand composer support links and drop vendor/bin from scripts
galetahub Aug 13, 2026
9bdc318
docs: removed unnecessary badges
galetahub Aug 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/serpapi-php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: PHP build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
Comment thread
galetahub marked this conversation as resolved.
Comment thread
galetahub marked this conversation as resolved.
Comment thread
galetahub marked this conversation as resolved.
Comment thread
galetahub marked this conversation as resolved.
Comment on lines +3 to +6

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only maintain master (no main). The workflow triggers are correct as-is - not planning to change this

Comment on lines +3 to +6
Comment on lines +2 to +6

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.5'
extensions: mbstring, intl, curl
tools: composer

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run linter
run: composer run-script lint

run:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
Comment thread
galetahub marked this conversation as resolved.
Comment on lines +29 to +32
steps:
- name: Checkout
uses: actions/checkout@v4
Comment thread
galetahub marked this conversation as resolved.

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, curl
Comment thread
galetahub marked this conversation as resolved.
ini-values: post_max_size=256M, max_execution_time=180

- name: Verify required PHP extensions
run: |
php -m | grep -i curl
php -m | grep -i json

- name: Validate composer.json
run: composer validate

- name: Cache Composer packages
uses: actions/cache@v4
with:
path: ~/.composer/cache
key: ${{ runner.os }}-php-${{ matrix.php-versions }}-composer-${{ hashFiles('composer.json') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php-versions }}-composer-

- name: Install dependencies
run: composer install --prefer-dist --no-progress
Comment thread
galetahub marked this conversation as resolved.

- name: Run test suite
run: composer run-script test
env:
API_KEY: ${{ secrets.API_KEY }}
Comment thread
galetahub marked this conversation as resolved.
Comment on lines +63 to +66
Comment on lines +63 to +66
Comment on lines +63 to +66
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
vendor/*
.vscode/*

# PHPUnit
.phpunit.result.cache

# MacOS Specific
.DS_Store

composer.lock
composer.phar
tmp/

.env
.env.*
21 changes: 21 additions & 0 deletions MIT-LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2018-2026 SerpApi

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The MIT license is supposed to have a copyright notice here, or it's a bit difficult to comply with the bit that starts "The above copyright notice".

Suggested change
Copyright 2024 SerpApi, LLC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Default target
all: install readme lint test

# Clean up the project
clean:
rm -rf vendor/

# Install the necessary libraries and dependencies
install:
composer install --prefer-dist --no-progress

# Run PSR12 lint
lint:
vendor/bin/phpcs

# Run the tests
test:
vendor/bin/phpunit -c phpunit.xml

# Generate README from ERB template
readme:
erb -T '-' README.md.erb > README.md
Loading
Loading