npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

opencontext

v2.0.0

Published

AI-powered company context analysis from your terminal. Extract comprehensive company profiles with a single command.

Downloads

606

Readme

OpenContext

Simple API for AI-powered company context analysis using Google Gemini

OpenContext is a lightweight Next.js API that extracts comprehensive company information from any website URL using Google's Gemini AI. Perfect for lead research, competitive analysis, and business intelligence.

✨ Features

  • 🤖 AI-Powered Analysis - Uses Google Gemini 3 Pro Preview to extract comprehensive company context
  • ⚡ Simple API - Single endpoint: URL input → structured JSON output
  • 🔒 Secure - Server-side API key configuration
  • 📊 Structured Output - Consistent JSON schema for easy integration

🚀 Quick Start

Prerequisites

Installation

  1. Clone the repository

    git clone https://github.com/federicodeponte/opencontext.git
    cd opencontext
  2. Install dependencies

    npm install
  3. Configure environment variables

    cp .env.example .env.local

    Add your Gemini API key to .env.local:

    GEMINI_API_KEY=your_gemini_api_key_here
  4. Start the API server

    npm run dev

    The API will be available at http://localhost:3000

📖 API Usage

Endpoint

POST /api/analyze

Request

{
  "url": "https://example.com",
  "apiKey": "your-gemini-api-key"  // Optional if GEMINI_API_KEY env var is set
}

Response

{
  "company_name": "Example Company",
  "company_url": "https://example.com",
  "industry": "Technology",
  "description": "A comprehensive description of the company...",
  "products": ["Product 1", "Product 2"],
  "target_audience": "Tech startups and enterprises",
  "competitors": ["Competitor A", "Competitor B"],
  "tone": "Professional and technical",
  "pain_points": ["Problem 1", "Problem 2"],
  "value_propositions": ["Value 1", "Value 2"],
  "use_cases": ["Use case 1", "Use case 2"],
  "content_themes": ["Theme 1", "Theme 2"]
}

cURL Example

curl -X POST http://localhost:3000/api/analyze \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://anthropic.com"
  }'

JavaScript Example

const response = await fetch('/api/analyze', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    url: 'https://example.com'
  }),
});

const analysis = await response.json();
console.log(analysis);

🛠️ Technical Details

What Gets Extracted

The AI analyzes the website and extracts:

  • Company name and website
  • Industry and description
  • Products/services offered
  • Target audience
  • Main competitors
  • Brand tone and voice
  • Customer pain points
  • Value propositions
  • Use cases and applications
  • Content themes and topics

Project Structure

opencontext/
├── src/
│   ├── app/
│   │   ├── api/analyze/route.ts    # Main analysis API
│   │   ├── layout.tsx              # Minimal layout
│   │   └── page.tsx                # API documentation page
│   └── lib/
│       └── types.ts                # TypeScript definitions
├── .env.example                    # Environment template
└── README.md

🚀 Deployment

Vercel (Recommended)

  1. Push to GitHub

    git add .
    git commit -m "Initial commit"
    git push origin main
  2. Deploy to Vercel

    • Go to vercel.com
    • Import your GitHub repository
    • Add GEMINI_API_KEY environment variable
    • Deploy

Environment Variables

| Variable | Description | Required | |----------|-------------|----------| | GEMINI_API_KEY | Google Gemini API key | Yes |

🔧 Error Handling

The API returns appropriate HTTP status codes:

  • 200 - Success
  • 400 - Invalid request (missing URL)
  • 401 - Invalid API key
  • 503 - Service unavailable (missing API key configuration)
  • 500 - Internal server error

Example error response:

{
  "error": "Website analysis is temporarily unavailable. Please configure your Gemini API key."
}

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

📧 Support


Made with ❤️ by Federico de Ponte