• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
project logo

nucky

book-lookup-notion

use google book api to look up bibliographic metadata elements
Public
Like
1
book-lookup-notion
Home
Code
3
backend
4
README.md
C
cron-processor.ts
Branches
1
Pull requests
Remixes
1
History
Environment variables
2
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.
Sign up now
Code
/
README.md
Code
/
README.md
Search
5/23/2025
Viewing readonly version of main branch: v56
View latest version
README.md

Notion Book Database Auto-Populator

This Val automatically enriches your existing "val Book Lookup" database by fetching comprehensive metadata from Google Books API.

How It Works

You already have the perfect setup! Your "val Book Lookup" database contains:

  • Title ✓
  • Author ✓
  • ISBN ✓
  • Year Published ✓
  • Page Count ✓
  • Publisher ✓

The Val will:

  1. Find records with Title + Author but missing other data
  2. Search Google Books API for metadata
  3. Fill in the empty fields automatically

Current Workflow

Simple Option (What you have now):

  1. Add books to "val Book Lookup" → Enter Title + Author
  2. Run the Val → It fills in ISBN, Year, Pages, Publisher
  3. Link to your main Books database via Relations/Rollups

Enhanced Option (Add more data):

If you want richer metadata, you can add these optional columns to your "val Book Lookup" database:

  • Subtitle (Rich text)
  • Description (Rich text)
  • Categories (Multi-select)
  • Average Rating (Number)
  • Language (Rich text)
  • Preview Link (URL)
  • Info Link (URL)

The Val will automatically populate these if the columns exist!

Setup (Already Done!)

Your system is already configured! Just make sure:

  • NOTION_API_TOKEN points to your integration
  • NOTION_DATABASE_ID points to your "val Book Lookup" database

Usage

Manual Processing

Visit: https://your-val-url.web.val.run/

Check Status

Visit: https://your-val-url.web.val.run/status

Automatic Processing

The cron job runs on schedule and emails you updates.

Linking to Your Main Books Database

To connect your "val Book Lookup" to your main reading database:

  1. Add Relation Property to your main Books database:

    • Name: "Book Info"
    • Type: Relation
    • Related database: "val Book Lookup"
  2. Add Rollup Properties to show metadata:

    • ISBN: Rollup → Book Info → ISBN
    • Year: Rollup → Book Info → Year Published
    • Pages: Rollup → Book Info → Page Count
    • Publisher: Rollup → Book Info → Publisher

Now when you add a book to your main database, just link it to the corresponding record in "val Book Lookup"!

API Endpoints

  • GET / - Process all incomplete records
  • GET /status - Check configuration
  • GET /process/:recordId - Process specific record
  • GET /health - Health check

Files

  • /backend/index.ts - Main HTTP handler
  • /backend/notion.ts - Notion API integration
  • /backend/books.ts - Google Books API with comprehensive metadata
  • /backend/processor.ts - Processing logic
  • /cron-processor.ts - Scheduled processing

Benefits

✅ Works with your existing setup
✅ Rich Google Books metadata
✅ Smart matching algorithm
✅ Only fills empty fields
✅ Links to your reading database
✅ Expandable with more metadata columns

FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.