openai_enrichment
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v50View latest version
An HTTP endpoint that enriches person data using OpenAI's web search capabilities. Provide basic information about a person (email, name, etc.) and get back comprehensive research about them.
- Set your OpenAI API key as an environment variable:
OPENAI_API_KEY
- The API uses the
gpt-4o-search-preview
model with web search capabilities
- Method: POST
- Content-Type: application/json
{ "email": "person@example.com", "name": "John Doe", "company": "Example Corp", "linkedin": "https://linkedin.com/in/johndoe", "twitter": "https://twitter.com/johndoe", "website": "https://johndoe.com" }
Note: At least one field is required. You can provide any combination of the above fields.
{ "success": true, "data": { "summary": "Brief overview of the person", "professional_background": "Career history and education", "current_role": "Current position and responsibilities", "company_info": "Information about their company", "recent_activities": "Recent news and projects", "social_presence": "Online presence and thought leadership", "achievements": "Notable accomplishments", "sources": ["https://example.com", "LinkedIn profile", "..."] } }
{ "success": false, "error": "Error description" }
curl -X POST https://your-val-url.web.val.run \ -H "Content-Type: application/json" \ -d '{ "email": "elon@tesla.com", "name": "Elon Musk" }'
const response = await fetch('https://your-val-url.web.val.run', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: 'person@example.com',
name: 'John Doe'
})
});
const data = await response.json();
console.log(data);
- Web Search Integration: Uses OpenAI's latest web search capabilities
- Comprehensive Research: Provides structured information across multiple categories
- Flexible Input: Accepts various identifiers (email, name, social profiles, etc.)
- Source Attribution: Returns sources where information was found
- Error Handling: Graceful error handling with descriptive messages
This tool is designed for legitimate business purposes such as:
- Sales prospecting and lead qualification
- Partnership research
- Due diligence for business relationships
- Professional networking
Please ensure you comply with:
- GDPR and other privacy regulations
- Your organization's data handling policies
- Ethical guidelines for data collection and use
- Terms of service of the platforms being researched
The API is subject to OpenAI's rate limits for the gpt-4o-search-preview
model. Consider implementing your own rate limiting if needed for production use.