FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
stevekrouse
stevekrouseopenai_enrichment
Public
Like
openai_enrichment
Home
Code
5
.vtignore
README.md
deno.json
index.html
H
index.ts
Branches
2
Pull requests
Remixes
History
Environment variables
1
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in miliseconds.
Sign up now
Code
/
Code
/
Search
index.ts
https://stevekrouse--c0a859303fd611f0aa5d76b3cceeab13.web.val.run
README.md

Person Enrichment API

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.

Setup

  1. Set your OpenAI API key as an environment variable: OPENAI_API_KEY
  2. The API uses the gpt-4o-search-preview model with web search capabilities

Usage

Endpoint

  • Method: POST
  • Content-Type: multipart/form-data

Request Body (Form Data)

The API accepts form data with the following fields:

  • email (optional): Person's email address
  • name (optional): Person's full name
  • company (optional): Company name
  • linkedin (optional): LinkedIn profile URL
  • twitter (optional): Twitter profile URL
  • website (optional): Personal or company website URL

Note: At least one field is required. You can provide any combination of the above fields as form data.

Response

Success Response (200)

{ "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", "..."] } }

Error Response (400/405/500)

{ "success": false, "error": "Error description" }

Common Error Cases:

  • 405 Method Not Allowed: Only POST requests are accepted
  • 400 Bad Request: No identifiers provided (at least one field required)
  • 500 Internal Server Error: OpenAI API error or processing failure

Example Usage

cURL

curl -X POST https://your-val-url.web.val.run \ -F "email=elon@tesla.com" \ -F "name=Elon Musk"

JavaScript (using FormData)

const formData = new FormData(); formData.append('email', 'person@example.com'); formData.append('name', 'John Doe'); const response = await fetch('https://your-val-url.web.val.run', { method: 'POST', body: formData }); const data = await response.json(); console.log(data);

HTML Form

<form action="https://your-val-url.web.val.run" method="POST"> <input type="email" name="email" placeholder="Email address"> <input type="text" name="name" placeholder="Full name"> <input type="text" name="company" placeholder="Company"> <input type="url" name="linkedin" placeholder="LinkedIn URL"> <input type="url" name="twitter" placeholder="Twitter URL"> <input type="url" name="website" placeholder="Website URL"> <button type="submit">Research Person</button> </form>

Features

  • Web Search Integration: Uses OpenAI's gpt-4o-search-preview model with web search capabilities
  • Form Data Support: Accepts standard HTML form submissions and FormData objects
  • 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
  • Method Validation: Only accepts POST requests for security

Privacy & Ethics

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

Rate Limits

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.

HTTP
  • index.ts
    stevekrouse--c0…13.web.val.run
Code
.vtignoreREADME.mddeno.jsonindex.html
H
index.ts
Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.