What does ocean-watch do?
Ocean Engine Advertising Codex Skill: Complete OAuth authorization, ad campaign creation, creative query, creative dimension report aggregation, and monitoring strategy analysis locally via the official Ocean Engine Marketing API. Supports product template configuration, bulk campaign creation from today's video creatives, concurrent multi-account management, and secure local credential storage.
Overview
This skill uses the official Ocean Engine Marketing API to execute advertising workflows directly on your local machine. It handles the entire lifecycle from authorization (OAuth) to campaign management and performance monitoring.
Features
- Local OAuth Authorization: Authenticate securely without exposing tokens over the network.
- Ad Campaign Creation: Define and launch campaigns programmatically using campaign templates.
- Creative Query & Reports: Retrieve creative assets and aggregated report data at the creative dimension level.
- Monitoring Strategy Analysis: Set up and analyze monitoring strategies to track campaign performance.
- Product Template Configuration: Pre-configure product templates to accelerate campaign creation.
- Bulk Campaign Creation from Today's Videos: Automatically batch-create campaigns using video creatives uploaded within the current day.
- Concurrent Multi-Account Support: Operate on multiple ad accounts simultaneously for higher efficiency.
- Secure Local Credential Storage: Store API keys and tokens locally with encryption to prevent leakage.
Prerequisites
- Codex environment (local setup)
- A valid Ocean Engine developer account with API access
- App ID and Secret from Ocean Engine Open Platform
- (Optional) Access tokens for each ad account you manage
Installation
- Clone this skill's repository to your local Codex skills directory.
- Install required dependencies:
pip install -r requirements.txt
- Set up environment variables or a config file with your credentials:
OCEAN_APP_ID=your_app_id
OCEAN_APP_SECRET=your_app_secret
Usage
- Authorize: Run the OAuth flow to obtain access tokens for your ad accounts.
- Configure Templates: Define product templates in the config file or via the provided template editor.
- Create Campaigns: Use the skill to create campaigns, specifying targeting, budget, creatives, and schedule.
- Monitor: Set up monitoring rules and get automated alerts or reports.
Example Commands
# Authorize an ad account
codex skill run westng/ocean-watch --action authorize --account-id 12345
# Create a campaign from a template
codex skill run westng/ocean-watch --action create-campaign --template-id "template_video_sale"
# Query creative performance reports
codex skill run westng/ocean-watch --action report --dimension creative --date-range last_7_days
Configuration
All configuration is stored in a local config.yaml or .env file. Example:
credentials:
app_id: "your_app_id"
app_secret: "your_app_secret"
accounts:
- id: "12345"
name: "Main Account"
- id: "67890"
name: "Test Account"
templates:
- id: "template_video_sale"
name: "Video Sales Campaign"
budget: 100000
bid_type: "CPM"
creative_type: "video"
Security Notes
- Credentials are encrypted at rest using local machine key storage.
- OAuth tokens are never transmitted to third parties.
- Logs are sanitized to avoid leaking sensitive information.
Troubleshooting
- Authorization failed: Verify app ID and secret in config, and ensure redirect URL matches the one registered in Ocean Engine.
- API rate limit: The skill implements exponential backoff; you may also stagger requests across accounts.
- Template not found: Ensure template ID is correctly spelled and exists in your config file.
License
MIT