{"id":20884079,"url":"https://github.com/emms21/adalchemyaiapicalls","last_synced_at":"2026-05-07T09:36:38.485Z","repository":{"id":256482463,"uuid":"851913317","full_name":"EmmS21/AdAlchemyAIAPICalls","owner":"EmmS21","description":"API calls to interact with Google Ads and Google Analytics APIs for AdAlchemyAI","archived":false,"fork":false,"pushed_at":"2024-09-25T20:46:06.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-09T09:32:48.314Z","etag":null,"topics":["fastapi","google-ads-api","google-analytics-api","google-cloud","mongodb","pydantic","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EmmS21.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-09-03T22:46:05.000Z","updated_at":"2025-09-10T13:06:47.000Z","dependencies_parsed_at":"2024-09-11T02:31:52.925Z","dependency_job_id":"0accc2af-8bf2-4a21-86ef-1364d45cb96f","html_url":"https://github.com/EmmS21/AdAlchemyAIAPICalls","commit_stats":null,"previous_names":["emms21/adalchemyaiapicalls"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/EmmS21/AdAlchemyAIAPICalls","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EmmS21%2FAdAlchemyAIAPICalls","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EmmS21%2FAdAlchemyAIAPICalls/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EmmS21%2FAdAlchemyAIAPICalls/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EmmS21%2FAdAlchemyAIAPICalls/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EmmS21","download_url":"https://codeload.github.com/EmmS21/AdAlchemyAIAPICalls/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EmmS21%2FAdAlchemyAIAPICalls/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32731887,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-07T02:14:30.463Z","status":"ssl_error","status_checked_at":"2026-05-07T02:14:29.405Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["fastapi","google-ads-api","google-analytics-api","google-cloud","mongodb","pydantic","python"],"created_at":"2024-11-18T08:08:59.753Z","updated_at":"2026-05-07T09:36:38.447Z","avatar_url":"https://github.com/EmmS21.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FastAPI Applications\n\nThis repository contains two FastAPI applications:\n\n1. [Google Ads API FastAPI Application](#google-ads-api-fastapi-application)\n2. [FastAPI MongoDB Update Service](#fastapi-mongodb-update-service)\n\n## Google Ads API FastAPI Application\n\nThis FastAPI application provides an interface to interact with the Google Ads API. It offers endpoints for authentication, campaign management, and ad creation.\n\n### Endpoints\n\n#### Authentication\n\n- **POST /authenticate**\n  - Authenticates the user with Google Ads.\n  - If a refresh token exists, it confirms authentication.\n  - If no refresh token exists, it provides an auth URL for the OAuth flow.\n  - Request body: `AuthRequest` (customer_id, credentials)\n  - Response: Authentication status or auth URL\n\n#### Campaigns\n\n- **POST /get_campaigns**\n  - Retrieves a list of campaigns for the authenticated user.\n  - Request body: `CampaignsList` (customer_id, credentials)\n  - Response: List of campaigns\n\n- **POST /create_campaign**\n  - Creates a new campaign.\n  - Request body: `CampaignCreate` (customer_id, campaign_name, daily_budget, start_date, end_date, credentials)\n  - Response: Confirmation message and campaign ID\n\n- **POST /update_campaign**\n  - Updates the budget of an existing campaign.\n  - Request body: `BudgetUpdate` (customer_id, campaign_name, new_budget, credentials)\n  - Response: Confirmation of update\n\n#### Ads\n\n- **POST /create_ad**\n  - Creates a new search ad within a specified campaign.\n  - Request body: `AdCreate` (customer_id, campaign_name, headlines, descriptions, keywords, credentials)\n  - Response: Confirmation message and ad group ID\n\n### Authentication Flow\n\n1. Call `/authenticate` to start the authentication process.\n2. If not authenticated, use the provided auth URL to complete the OAuth flow.\n3. After OAuth completion, the application will store the refresh token for future use.\n\n### Error Handling\n\nAll endpoints include error handling for various scenarios, including Google Ads API errors and general exceptions. Errors are returned with appropriate HTTP status codes and detailed error messages.\n\n### Note\n\nEnsure that you have the necessary Google Ads API credentials and permissions before using these endpoints. The application expects the credentials to be provided in the request body for each operation.\n\n## FastAPI MongoDB Update Service\n\nThis is a simple FastAPI application that provides an endpoint to update items in a MongoDB collection.\n\n### Requirements\n\n- Python 3.7+\n- FastAPI\n- Pydantic\n- PyMongo\n- MongoDB\n\n### Installation\n\n1. Clone the repository:\n    ```sh\n    git clone https://github.com/yourusername/fastapi-mongodb-update-service.git\n    cd fastapi-mongodb-update-service\n    ```\n\n2. Create a virtual environment and activate it:\n    ```sh\n    python -m venv venv\n    source venv/bin/activate  \n    ```\n\n3. Install the dependencies:\n    ```sh\n    pip install -r requirements.txt\n    ```\n\n4. Set the MongoDB connection string in your environment variables:\n    ```sh\n    export MONGO=\"your_mongodb_connection_string\"\n    ```\n\n### Running the Application\n\nStart the FastAPI server:\n    ```sh\n    uvicorn main:app --reload\n    ```\n\n### Endpoints\n\n- **PUT /update_item**\n  - Updates an item in the MongoDB collection.\n  - Request body: `UpdateItemRequest` (item_id, update_data)\n  - Response: Confirmation message\n\n### Error Handling\n\nThe endpoint includes error handling for various scenarios, including MongoDB errors and general exceptions. Errors are returned with appropriate HTTP status codes and detailed error messages.\n\n### Note\n\nEnsure that you have the necessary MongoDB connection string set in your environment variables before running the application.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femms21%2Fadalchemyaiapicalls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femms21%2Fadalchemyaiapicalls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femms21%2Fadalchemyaiapicalls/lists"}