123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542 |
- openapi: 3.0.0
- info:
- title: BYOM Trends API
- version: '1.0'
- description: API for managing BYOM Trends
- contact:
- name: BYOM Support
- servers:
- - url: /api/v1/trends
- description: BYOM Trends API
- tags:
- - name: Trends
- description: Trend analysis operations
- - name: Social
- description: Social media profile operations
- - name: Google
- description: Google Trends operations
- - name: Suggestions
- description: Product and service suggestions based on trend analysis
- paths:
- /api/v1/trends/analyze/profile/{id}:
- post:
- tags:
- - Trends
- summary: Analyze trends for a social media profile
- parameters:
- - name: id
- in: path
- required: true
- schema:
- type: string
- format: uuid
- description: Profile ID to analyze
- responses:
- '201':
- description: Trend analysis created successfully
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/TrendAnalysis'
- '404':
- description: Profile not found
- '500':
- description: Internal server error
- /api/v1/trends/analysis/{id}:
- get:
- tags:
- - Trends
- summary: Get trend analysis report
- parameters:
- - name: id
- in: path
- required: true
- schema:
- type: string
- format: uuid
- description: Analysis ID
- responses:
- '200':
- description: Trend analysis retrieved successfully
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/TrendAnalysis'
- '404':
- description: Analysis not found
- '500':
- description: Internal server error
- /api/v1/trends/social/connect:
- post:
- tags:
- - Social
- summary: Connect a social media profile
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ConnectProfileRequest'
- responses:
- '201':
- description: Profile connected successfully
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/SocialProfile'
- '400':
- description: Invalid request
- '500':
- description: Internal server error
- /api/v1/trends/google/analyze:
- post:
- tags:
- - Google
- summary: Analyze Google Trends data
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/GoogleTrendsRequest'
- responses:
- '200':
- description: Analysis successful
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/GoogleTrendsResponse'
- '400':
- description: Invalid request
- '500':
- description: Internal server error
- /api/v1/trends/google/topics:
- get:
- tags:
- - Google
- summary: Get related topics for keywords
- parameters:
- - name: keyword
- in: query
- required: true
- schema:
- type: string
- description: Keyword to get related topics for
- responses:
- '200':
- description: Related topics retrieved successfully
- content:
- application/json:
- schema:
- type: array
- items:
- $ref: '#/components/schemas/RelatedTopic'
- '400':
- description: Invalid request
- '500':
- description: Internal server error
- /api/v1/trends/google/regional:
- get:
- tags:
- - Google
- summary: Get regional interest data
- parameters:
- - name: keyword
- in: query
- required: true
- schema:
- type: string
- description: Keyword to get regional interest for
- - name: region
- in: query
- required: false
- schema:
- type: string
- description: Specific region to analyze
- responses:
- '200':
- description: Regional interest data retrieved successfully
- content:
- application/json:
- schema:
- type: object
- additionalProperties:
- type: integer
- '400':
- description: Invalid request
- '500':
- description: Internal server error
- /api/v1/trends/google/analysis/{id}:
- get:
- tags:
- - Google
- summary: Get Google Trends analysis by ID
- parameters:
- - name: id
- in: path
- required: true
- schema:
- type: string
- format: uuid
- description: Analysis ID
- responses:
- '200':
- description: Analysis retrieved successfully
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/GoogleTrend'
- '404':
- description: Analysis not found
- '500':
- description: Internal server error
- /api/v1/trends/social/{platform}/stats:
- get:
- tags:
- - Social
- summary: Get platform-specific statistics
- parameters:
- - name: platform
- in: path
- required: true
- schema:
- type: string
- enum: [instagram, tiktok, youtube]
- description: Social media platform
- responses:
- '200':
- description: Platform statistics retrieved successfully
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/PlatformStats'
- '400':
- description: Invalid platform
- '500':
- description: Internal server error
- /api/v1/trends/social/{platform}/engagement/{id}:
- get:
- tags:
- - Social
- summary: Get engagement metrics for a social profile
- parameters:
- - name: platform
- in: path
- required: true
- schema:
- type: string
- enum: [instagram, tiktok, youtube]
- description: Social media platform
- - name: id
- in: path
- required: true
- schema:
- type: string
- format: uuid
- description: Profile ID
- responses:
- '200':
- description: Engagement metrics retrieved successfully
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/EngagementMetrics'
- '404':
- description: Profile not found
- '500':
- description: Internal server error
- /api/v1/trends/suggestions:
- post:
- tags:
- - Suggestions
- summary: Get product suggestions based on social trends
- description: Analyzes social media trends and suggests potential products or services
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/GetSuggestionsRequest'
- responses:
- '200':
- description: Suggestions retrieved successfully
- content:
- application/json:
- schema:
- type: array
- items:
- $ref: '#/components/schemas/ProductSuggestion'
- '400':
- description: Invalid request format
- '500':
- description: Internal server error
- /api/v1/trends/suggestions/user/{user_id}:
- get:
- tags:
- - Suggestions
- summary: Get all suggestions for a user
- parameters:
- - name: user_id
- in: path
- required: true
- schema:
- type: string
- responses:
- '200':
- description: Suggestions retrieved successfully
- content:
- application/json:
- schema:
- type: array
- items:
- $ref: '#/components/schemas/ProductSuggestion'
- /api/v1/trends/suggestions/{id}:
- get:
- tags:
- - Suggestions
- summary: Get a specific suggestion
- parameters:
- - name: id
- in: path
- required: true
- schema:
- type: string
- format: uuid
- responses:
- '200':
- description: Suggestion retrieved successfully
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProductSuggestion'
- components:
- schemas:
- TrendAnalysis:
- type: object
- properties:
- id:
- type: string
- format: uuid
- profile_id:
- type: string
- format: uuid
- type:
- type: string
- enum: [social, google]
- created_at:
- type: string
- format: date-time
- updated_at:
- type: string
- format: date-time
- SocialProfile:
- type: object
- properties:
- id:
- type: string
- format: uuid
- platform:
- type: string
- enum: [instagram, tiktok, youtube]
- username:
- type: string
- profile_url:
- type: string
- follower_count:
- type: integer
- format: int64
- engagement:
- type: number
- format: float
- created_at:
- type: string
- format: date-time
- updated_at:
- type: string
- format: date-time
- ConnectProfileRequest:
- type: object
- required:
- - platform
- - username
- properties:
- platform:
- type: string
- enum: [instagram, tiktok, youtube]
- username:
- type: string
- GoogleTrendsRequest:
- type: object
- required:
- - keywords
- properties:
- keywords:
- type: array
- items:
- type: string
- time_range:
- type: string
- enum: [LAST_HOUR, LAST_DAY, LAST_WEEK, LAST_MONTH]
- region:
- type: string
- GoogleTrendsResponse:
- type: object
- properties:
- results:
- type: object
- additionalProperties:
- type: integer
- related_topics:
- type: object
- additionalProperties:
- type: array
- items:
- $ref: '#/components/schemas/RelatedTopic'
- regional_interest:
- type: object
- additionalProperties:
- type: integer
- RelatedTopic:
- type: object
- properties:
- title:
- type: string
- type:
- type: string
- value:
- type: integer
- GoogleTrend:
- type: object
- properties:
- id:
- type: string
- format: uuid
- keyword:
- type: string
- interest_over_time:
- type: object
- additionalProperties:
- type: integer
- created_at:
- type: string
- format: date-time
- PlatformStats:
- type: object
- properties:
- platform:
- type: string
- enum: [instagram, tiktok, youtube]
- total_profiles:
- type: integer
- avg_engagement:
- type: number
- format: float
- trending_topics:
- type: array
- items:
- type: string
- EngagementMetrics:
- type: object
- properties:
- profile_id:
- type: string
- format: uuid
- platform:
- type: string
- enum: [instagram, tiktok, youtube]
- engagement_rate:
- type: number
- format: float
- likes:
- type: integer
- comments:
- type: integer
- shares:
- type: integer
- period:
- type: string
- enum: [daily, weekly, monthly]
- timestamp:
- type: string
- format: date-time
- GetSuggestionsRequest:
- type: object
- required:
- - user_id
- - socials
- properties:
- user_id:
- type: string
- description: ID of the user requesting suggestions
- socials:
- type: array
- description: List of social media profiles to analyze for suggestions
- items:
- $ref: '#/components/schemas/Social'
- Social:
- type: object
- required:
- - platform
- - username
- properties:
- platform:
- type: string
- enum: [instagram, tiktok, youtube]
- username:
- type: string
- ProductSuggestion:
- type: object
- properties:
- name:
- type: string
- description: Name of the suggested product or service
- description:
- type: string
- description: Short description of the product/service
- target_audience:
- type: string
- description: Description of the target market
- relevance_score:
- type: number
- format: float
- minimum: 1
- maximum: 10
- description: Score indicating how well the suggestion matches current trends
- success_factors:
- type: array
- items:
- type: string
- description: List of factors supporting the potential success
- securitySchemes:
- BearerAuth:
- type: http
- scheme: bearer
- bearerFormat: JWT
- security:
- - BearerAuth: []
|