Elevate your PHP applications by effortlessly integrating Google services with this client. Designed for easy integration with Google API services, this PHP-based Google Search Console API Client and XML data parser simplifies the incorporation of Google web services into applications.
With seamless connectivity and comprehensive data exchange capabilities, it facilitates parsing SEO data from Google Search Console into XML format, enabling straightforward cross-server access.
Ideal for developers working with frameworks like Laravel, Symfony, WordPress, and PrestaShop, this versatile tool empowers users to access Google APIs with ease and obtain essential insights such as click numbers, position rankings, click-through rates, and impactful keywords for their websites and projects.
Follow these steps to set up the script in your PHP environment, including cloning the repository and installing dependencies.
Ensure PHP and Composer are installed on your server and machine. These are vital for dependency management and script execution.
- PHP: Installation Guide
- Composer: Getting Started Guide
Clone the repository to your machine or server:
git clone https://github.com/ricardomrcruz/PHP_Google_API_Client.git
cd PHP_Google_API_Client
After cloning, install PHP dependencies with:
composer require google/apiclient:^2.0
For specific dependency versions, use the project's composer.lock
:
composer install
To update dependencies:
composer update
Note: Commit your composer.lock
to version control to synchronize dependency versions across environments.
Set up your Google Client:
- Visit the Google Developers Console.
- Create or select a project.
- Under "Credentials", create your project's credentials (e.g., OAuth 2.0 Client IDs).
- Enable necessary APIs via the "Library" page. Specifically, add the Google Search Console API.
- Configure your OAuth 2.0 Client ID credentials with appropriate domains and redirect URLs.
- Download the client ID JSON file and upload it to your project folder.
- Delete the refresh access token that comes with the repository. Enter your query URL. Confirm your Google identity and watch your new refresh token get added to the project automatically.
These additional steps ensure that your Google Client is fully configured and ready to use within your project. They also guide you through the process of handling authentication and obtaining the necessary credentials for accessing Google APIs.
Include the correct scopes in your authentication flow as per the Google Identity Platform documentation.
For troubleshooting, contribution guidelines, or license information, feel free to add relevant sections.