Extract structured data from D&B company reports with GPT-4o
Pull a Dun & Bradstreet Business Information Report (PDF) by DUNS, convert the response into a binary PDF file, extract readable text, and use OpenAI to return a clean, flat JSON with only the key fields you care abou...
Template notes
Pull a Dun & Bradstreet Business Information Report (PDF) by DUNS, convert the response into a binary PDF file, extract readable text, and use OpenAI to return a clean, flat JSON with only the key fields you care about (e.g., report date, Paydex, viability score, credit limit). Includes Sticky Notes for quick setup help and guidance.
---
β What this template does - Requests a D&B report (PDF) for a specific DUNS via HTTP - Converts the API response into a binary PDF file - Extracts the text from the PDF for analysis - Uses OpenAI with a Structured Output Parser to return a flat JSON - Designed to be extended to Sheets, databases, or CRMs
---
π§© How it works (node-by-node) 1. Manual Trigger β Runs the workflow on demand ("When clicking 'Execute workflow'"). 2. D&B Report (HTTP Request) β Calls the D&B Reports API for a Business Information Report (PDF). 3. Convert to PDF File (Convert to File) β Turns the D&B response payload into a binary PDF. 4. Extract Binary (Extract from File) β Extracts text content from the PDF. 5. OpenAI Chat Model β Provides the language model context for the analyzer. 6. Analyze PDF (AI Agent) β Reads the extracted text and applies strict rules for a flat JSON output. 7. Structured Output (AI Structured Output Parser) β Enforces a schema and validates/auto-fixes the JSON shape. 8. (Optional) Get Bearer Token (HTTP Request) β Template guidance for OAuth token retrieval (shown as disabled; included for reference if you prefer Bearer flows).
---
π οΈ Setup instructions (from the JSON)
1) D&B Report (HTTP Request) - Auth: Header Auth (use an n8n HTTP Header Auth credential) - URL: https://plus.dnb.com/v1/reports/duns/804735132?productId=birstd&inLanguage=en-US&reportFormat=PDF&orderReason=6332&tradeUp=hq&customerReference=customer%20reference%20text