{"id":15026890,"url":"https://github.com/yashgupta-dev/api-bridge","last_synced_at":"2026-02-12T03:34:05.824Z","repository":{"id":252657968,"uuid":"841064830","full_name":"yashgupta-dev/api-bridge","owner":"yashgupta-dev","description":"Unified PHP Client for X, Facebook, and Google Maps","archived":false,"fork":false,"pushed_at":"2024-08-11T14:51:34.000Z","size":915,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-05T11:02:06.653Z","etag":null,"topics":["composer-library","facebook","facebook-api","google","maps-api","php","php8","twitter-api"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yashgupta-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-11T14:37:08.000Z","updated_at":"2024-08-11T14:51:37.000Z","dependencies_parsed_at":"2024-08-11T16:08:37.880Z","dependency_job_id":null,"html_url":"https://github.com/yashgupta-dev/api-bridge","commit_stats":null,"previous_names":["yashgupta-dev/api-bridge"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/yashgupta-dev/api-bridge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yashgupta-dev%2Fapi-bridge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yashgupta-dev%2Fapi-bridge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yashgupta-dev%2Fapi-bridge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yashgupta-dev%2Fapi-bridge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yashgupta-dev","download_url":"https://codeload.github.com/yashgupta-dev/api-bridge/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yashgupta-dev%2Fapi-bridge/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273747788,"owners_count":25160652,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-05T02:00:09.113Z","response_time":402,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["composer-library","facebook","facebook-api","google","maps-api","php","php8","twitter-api"],"created_at":"2024-09-24T20:05:20.536Z","updated_at":"2026-02-12T03:34:05.743Z","avatar_url":"https://github.com/yashgupta-dev.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# APIBridge: Unified PHP Client for Twitter, Facebook, and Google Maps\n\n## Overview\n\n**APIBridge** is a PHP client library designed to simplify interactions with popular APIs including Twitter, Facebook, and Google Maps. This library provides an intuitive and unified interface for making API requests, handling authentication, and parsing responses.\n\n## Features\n\n- **Twitter Integration**: Fetch user details and recent tweets.\n- **Facebook Integration**: Retrieve user information and page posts.\n- **Google Maps Integration**: Obtain geocoding and distance information.\n- **Error Handling**: Manage and handle API errors gracefully.\n\n## Installation\n\nTo get started with APIBridge, follow these steps:\n\n1. **Clone the Repository**:\n\n    ```bash\n    git clone https://github.com/yashgupta-dev/api-bridge.git\n    cd api-bridge\n    ```\n\n2. **Install Dependencies**:\n\n    Make sure you have [Composer](https://getcomposer.org/) installed. Then, run:\n\n    ```bash\n    composer install\n    ```\n\n## Configuration\n\nBefore using the API client, you need to set up authentication tokens and API keys for each service.\n\n### Example Configuration\n\n**File: `config.php`**\n\n```php\n\u003c?php\n\nrequire 'vendor/autoload.php';\n\nuse CodeCorner\\APIBridge\\services\\facebook\\FacebookClient;\nuse CodeCorner\\APIBridge\\services\\maps\\GoogleMapsClient;\nuse CodeCorner\\APIBridge\\services\\x\\X;\n\n// Set API keys and tokens\nX::setAuthToken('YOUR_TWITTER_BEARER_TOKEN');\nFacebookClient::setAuthToken('YOUR_FACEBOOK_ACCESS_TOKEN');\nGoogleMapsClient::setApiKey('YOUR_GOOGLE_MAPS_API_KEY');\n```\n\n## Usage\n\n### Twitter Client\n\n```php\n\u003c?php\n\nrequire 'config.php';\n\nuse CodeCorner\\APIBridge\\services\\x\\X;\n\n// Fetch user information\n$userData = X::getUser('twitter');\nprint_r($userData);\n\n// Fetch user tweets\n$tweetsData = X::getTweets('USER_ID');\nprint_r($tweetsData);\n```\n\n### Facebook Client\n\n```php\n\u003c?php\n\nrequire 'config.php';\n\nuse CodeCorner\\APIBridge\\services\\facebook\\FacebookClient;\n\n// Fetch user information\n$userData = FacebookClient::getUser('USER_ID');\nprint_r($userData);\n\n// Fetch page posts\n$pagePostsData = FacebookClient::getPagePosts('PAGE_ID');\nprint_r($pagePostsData);\n```\n\n### Google Maps Client\n\n```php\n\u003c?php\n\nrequire 'config.php';\n\nuse CodeCorner\\APIBridge\\services\\maps\\GoogleMapsClient;\n\n// Fetch geocode information\n$geocodeData = GoogleMapsClient::getGeocode('1600 Amphitheatre Parkway, Mountain View, CA');\nprint_r($geocodeData);\n\n// Fetch distance information\n$distanceData = GoogleMapsClient::getDistance('place_id:ChIJN1t_tDeuEmsRUsoyG83frY4', 'place_id:ChIJN1t_tDeuEmsRUsoyG83frY4');\nprint_r($distanceData);\n```\n\n## Running Tests\n\nTo ensure everything is working correctly, you can run the provided PHPUnit tests.\n\n1. **Install PHPUnit**:\n\n    ```bash\n    composer require --dev phpunit/phpunit\n    ```\n\n2. **Run Tests**:\n\n    ```bash\n    vendor/bin/phpunit tests/ApiClientTest.php\n    ```\n\n## API Reference\n\n### Twitter Client Methods\n\n- **`getUser($username)`**: Fetches user information by username.\n- **`getTweets($userId)`**: Retrieves recent tweets by user ID.\n\n### Facebook Client Methods\n\n- **`getUser($userId)`**: Retrieves user information by user ID.\n- **`getPagePosts($pageId)`**: Fetches posts from a Facebook page by page ID.\n\n### Google Maps Client Methods\n\n- **`getGeocode($address)`**: Retrieves geocoding information for a given address.\n- **`getDistance($origins, $destinations)`**: Fetches distance data between origins and destinations.\n\n## Contributing\n\nContributions are welcome! Please follow the guidelines in `CONTRIBUTING.md` for submitting pull requests and issues.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Contact\n\nFor any questions or issues, please contact us at [yash121999@gmail.com](mailto:yash121999@gmail.com).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyashgupta-dev%2Fapi-bridge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyashgupta-dev%2Fapi-bridge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyashgupta-dev%2Fapi-bridge/lists"}