graph TD
A[Start: Receive Amazon URL/ASIN] --> B[Initialize API Client]
B --> C[Extract Data from URL]
C --> D{Check URL Type}
D -->|Amazon URL| E[Parse Amazon URL for ASIN]
D -->|Direct ASIN| F[Use ASIN Directly]
E --> G[Call Amazon Product API]
F --> G
G --> H[Extract Main Elements]
H --> I[Title]
H --> J[Bullet Points]
H --> K[Description]
H --> L[Main Image URL]
I --> M[Data Validation]
J --> M
K --> M
L --> M
M --> N{Validation Check}
N -->|Failed| O[Log Error]
O --> P[Request New URL]
P --> A
N -->|Passed| Q[Format Data Structure]
Q --> R[Create JSON Output]
R --> S[Export Structured Data]
S --> T[End: Return Data Package]