# Og Polyglot (`mohit_upadhyay/og-polyglot`) Actor

OG Polyglot is an intelligent Apify Actor that scrapes Open Graph metadata from any webpage and automatically generates marketing-optimized, multilingual social media previews using Lingo.dev. Break language barriers and maximize your global reach with perfectly localized content.

- **URL**: https://apify.com/mohit\_upadhyay/og-polyglot.md
- **Developed by:** [Mohit Upadhyay](https://apify.com/mohit_upadhyay) (community)
- **Categories:** Automation, Developer tools, Social media
- **Stats:** 3 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.01 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## 🌐 OG Polyglot

**Transform Your Social Media Presence Globally with AI-Powered Translations**

[![Apify](https://img.shields.io/badge/Apify-Actor-3A50C2?style=flat-square)](https://apify.com)
[![Node.js](https://img.shields.io/badge/Node.js-18+-339933?style=flat-square\&logo=node.js)](https://nodejs.org)
[![Lingo.dev](https://img.shields.io/badge/Lingo.dev-SDK-FF6F61?style=flat-square\&logo=lingo.dev)](https://lingo.dev)

> **OG Polyglot** is an intelligent Apify Actor that scrapes Open Graph metadata from any webpage and automatically generates **marketing-optimized, multilingual social media previews** using AI-powered translations. Break language barriers and maximize your global reach with perfectly localized content.

***

### 🎯 What Problem Does This Solve?

When you share a link on social media (Facebook, Twitter, LinkedIn), platforms display a **preview card** with your title, description, and image. But here's the problem:

❌ **Most websites only have English Open Graph tags**\
❌ **Global audiences see content in the wrong language**\
❌ **Manual translation is time-consuming and expensive**\
❌ **You need marketing expertise for each language**\
❌ **Testing previews across languages is tedious**

#### ✅ OG Polyglot's Solution

Instead of writing multilingual meta tags yourself, **OG Polyglot automatically**:

1. 🕷️ **Scrapes** your page's existing Open Graph metadata
2. 🤖 **Translates** it into multiple languages using [Lingo.dev AI](https://lingo.dev)
3. 🎨 **Optimizes** translations with marketing tones (Clickbait, Professional, Urgent, Friendly)
4. 🖼️ **Generates** visual HTML preview cards to see exactly how posts will look
5. 📋 **Provides** ready-to-use HTML snippets you copy-paste into your website

***

### 🚀 How It Works (3 Simple Steps)

```
┌─────────────────┐
│  1. SCRAPE      │   Extract Open Graph metadata from your URL
│  🕷️ Crawling    │   (og:title, og:description, og:image)
└────────┬────────┘
         │
         ▼
┌─────────────────┐
│  2. TRANSLATE   │   AI-powered translation with Lingo.dev
│  🤖 Processing  │   Apply marketing tone for max CTR
└────────┬────────┘
         │
         ▼
┌─────────────────┐
│  3. GENERATE    │   Create HTML previews + meta tag snippets
│  📦 Output      │   Save to Dataset + Key-Value Store
└─────────────────┘
```

***

### 📊 Input Parameters

| Parameter         | Type    | Description                                                                      | Default                  | Required |
| ----------------- | ------- | -------------------------------------------------------------------------------- | ------------------------ | -------- |
| `url`             | String  | Website URL to scrape OG metadata from                                           | `https://blog.apify.com` | ✅       |
| `targetLanguages` | Array   | ISO 639-1 language codes (e.g., `["ja", "es", "fr"]`)                            | `["ja"]`                 | ✅       |
| `marketingTone`   | String  | Translation style: `Standard`, `Clickbait`, `Professional`, `Urgent`, `Friendly` | `Standard`               | ❌       |
| `lingoApiKey`     | String  | Your [Lingo.dev API key](https://lingo.dev) (leave empty for test mode)          | `""`                     | ❌       |
| `enableTestMode`  | Boolean | Use mock translations instead of real API                                        | `false`                  | ❌       |

#### 🎨 Marketing Tone Guide

| Tone             | Best For              | Example Transformation                                                                |
| ---------------- | --------------------- | ------------------------------------------------------------------------------------- |
| **Standard**     | Neutral content       | "Learn about web scraping" → "ウェブスクレイピングについて学ぶ"                       |
| **Clickbait**    | Viral content, blogs  | "Learn about web scraping" → "誰も教えてくれなかったウェブスクレイピングの秘密 🚀"    |
| **Professional** | B2B, corporate        | "Learn about web scraping" → "エンタープライズ向けウェブスクレイピングソリューション" |
| **Urgent**       | Sales, limited offers | "Learn about web scraping" → "今すぐ始めよう！ウェブスクレイピング完全ガイド ⏰"      |
| **Friendly**     | Community, lifestyle  | "Learn about web scraping" → "一緒にウェブスクレイピングを楽しく学ぼう！ 😊"          |

***

### 📤 Output Format

#### Dataset (JSON)

Three views available:

**1. Overview** - All localized content

```json
{
    "language": "ja",
    "marketing_tone": "Clickbait",
    "localized_title": "誰も教えてくれなかったウェブスクレイピングの秘密",
    "localized_description": "最新のApifyプラットフォームで...",
    "html_snippet": "<meta property=\"og:locale:alternate\" content=\"ja\" />...",
    "preview_url": "https://api.apify.com/v2/key-value-stores/.../PREVIEW_JA"
}
```

**2. Before & After** - Compare original vs translated

```json
{
    "language": "ja",
    "original_title": "Learn Web Scraping with Apify",
    "localized_title": "Apifyでウェブスクレイピングを学ぼう",
    "original_description": "Discover how to...",
    "localized_description": "データ抽出の方法を..."
}
```

**3. Snippets Only** - Just the HTML code

```json
{
    "language": "ja",
    "html_snippet": "<!-- Social Media Preview for JA -->\n<meta property=\"og:locale:alternate\"..."
}
```

#### Visual HTML Previews (Key-Value Store)

Each language gets a beautiful standalone HTML preview showing:

- ✅ Side-by-side comparison (original vs translated)
- ✅ Facebook card mockup
- ✅ Twitter card mockup
- ✅ Copy-paste HTML snippet
- ✅ Marketing tone badge

Access via: `PREVIEW_JA`, `PREVIEW_ES`, `PREVIEW_FR`, etc.

***

### 🎯 Use Cases

#### 1️⃣ **Global Content Creators**

**Scenario:** You run a travel blog in English but want to reach Japanese and Korean audiences.

**Solution:** Run OG Polyglot on your top articles → Get Japanese/Korean social previews → When Japanese users share on Twitter, they see localized text → 📈 **3x higher engagement rates**

#### 2️⃣ **E-Commerce Stores**

**Scenario:** Product pages need multilingual social cards for international marketing campaigns.

**Solution:** Bulk process product URLs → Apply "Urgent" tone for sales → Generate localized previews for Facebook Ads → 💰 **Increase conversions by targeting native speakers**

#### 3️⃣ **SaaS Companies**

**Scenario:** Launching in new markets (Germany, France, Spain) but website is English-only.

**Solution:** Use "Professional" tone → Generate corporate-quality translations → A/B test which language performs best → 🚀 **Enter new markets faster**

#### 4️⃣ **News Publishers**

**Scenario:** Breaking news needs to spread globally within minutes.

**Solution:** Enable test mode for instant previews → Publish with multilingual OG tags → Social media algorithms auto-show correct language → ⚡ **Viral distribution across languages**

#### 5️⃣ **Marketing Agencies**

**Scenario:** Client wants to run multilingual social campaigns but has no translation budget.

**Solution:** OG Polyglot as white-label service → Generate 10 languages in one run → Deliver professional-quality previews → 💼 **Scale client delivery 10x**

***

### 📖 Real-World Example

**Before:**

```html
<meta property="og:title" content="Tokyo Travel Guide 2025" />
<meta property="og:description" content="Discover hidden gems in Tokyo..." />
```

When a Spanish user shares → Shows English text → Low engagement 😞

**After Using OG Polyglot:**

```html
<!-- Original English -->
<meta property="og:title" content="Tokyo Travel Guide 2025" />

<!-- Generated Spanish (Friendly tone) -->
<meta property="og:locale:alternate" content="es" />
<meta property="og:title" content="¡Descubre Tokio como un local! 🗾 Guía 2025" />
<meta property="og:description" content="Los mejores lugares secretos que solo los residentes conocen..." />
```

Spanish users see Spanish preview → **Higher CTR, more shares** 🎉

***

### 🤝 Who Is This For?

✅ **International Content Creators** - Reach audiences in their native language\
✅ **E-Commerce Owners** - Localize product social cards for global markets\
✅ **Marketing Agencies** - Deliver multilingual campaigns without hiring translators\
✅ **SaaS Startups** - Test international expansion with minimal investment\
✅ **News Publishers** - Distribute breaking news across language barriers\
✅ **SEO Specialists** - Optimize social media CTR for international keywords\
✅ **Developers** - Automate metadata generation for client projects

***

### ⚡ FAQ

**Q: Do I need to own the website to use this?**\
A: Yes. You can only implement the generated HTML snippets on websites you control. The Actor scrapes public OG tags but you must add translations to YOUR site's `<head>` section.

**Q: Is this better than Google Translate?**\
A: Absolutely! Google Translate provides literal word-for-word translations. OG Polyglot uses AI to understand **marketing context** and applies tones for maximum social media engagement.

**Q: How do I implement the translations on my website?**\
A: Copy the `html_snippet` from the dataset output and paste it into your webpage's `<head>` section.

***

### 🔗 Resources

- **[Lingo.dev Translation API](https://lingo.dev)** - AI translation engine
- **[Apify Platform Documentation](https://docs.apify.com)** - Actor framework
- **[Open Graph Protocol](https://ogp.me/)** - OG metadata specification
- **[Twitter Card Validator](https://cards-dev.twitter.com/validator)** - Test Twitter previews
- **[Facebook Sharing Debugger](https://developers.facebook.com/tools/debug/)** - Test Facebook previews
- **[Crawlee Documentation](https://crawlee.dev/)** - Web scraping library
- **[Apify SDK for JavaScript](https://docs.apify.com/sdk/js)** - SDK reference

***

### 🙏 Acknowledgments

Built with:

- **[Apify SDK](https://docs.apify.com/sdk/js)** - Web automation platform
- **[Crawlee](https://crawlee.dev/)** - Web scraping framework
- **[Lingo.dev](https://lingo.dev)** - AI translation engine

***

**🌍 Break Language Barriers. Reach the World. 🚀**

*Built with ❤️ for the global creator community*

# Actor input Schema

## `url` (type: `string`):

The website URL to scrape Open Graph metadata from

## `marketingTone` (type: `string`):

The tone to apply when translating for maximum CTR on social media

## `targetLanguages` (type: `array`):

ISO 639-1 language codes to translate into

## `lingoApiKey` (type: `string`):

Your Lingo.dev API key (get it from https://lingo.dev). Leave empty for test mode (demo translations only).

## `enableTestMode` (type: `boolean`):

When enabled, uses mock translations instead of real Lingo.dev API (useful for testing without API key)

## Actor input object example

```json
{
  "url": "https://example.com/blog-post",
  "marketingTone": "Standard",
  "targetLanguages": [
    "ja"
  ],
  "enableTestMode": false
}
```

# Actor output Schema

## `visualPreviews` (type: `string`):

Interactive HTML previews showing how your social media cards will look

## `localizedData` (type: `string`):

All translated metadata in JSON format for developers

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "url": "https://blog.apify.com",
    "targetLanguages": [
        "ja"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("mohit_upadhyay/og-polyglot").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "url": "https://blog.apify.com",
    "targetLanguages": ["ja"],
}

# Run the Actor and wait for it to finish
run = client.actor("mohit_upadhyay/og-polyglot").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "url": "https://blog.apify.com",
  "targetLanguages": [
    "ja"
  ]
}' |
apify call mohit_upadhyay/og-polyglot --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=mohit_upadhyay/og-polyglot",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/3RuGT2wlsfTk7hiyH/builds/ea7hfAPucOa6y2WWY/openapi.json
