Archive

Posts Tagged ‘digital-marketing’

Enrich Your Qualtrics Surveys with Real-Time Respondent Data Using AvatarAPI

Qualtrics is excellent at capturing what respondents tell you. But what if you could automatically fill in what you already know — or can discover — the moment they enter their email address?

AvatarAPI resolves an email address into rich profile data in real time: a profile photo, full name, city, country, and the social network behind it. By embedding this lookup directly into your Qualtrics survey flow, you collect more information about each respondent without asking a single extra question.


What Data Does AvatarAPI Return?

When you pass an email address to the API, it returns the following fields — all of which can be mapped into Qualtrics Embedded Data and used anywhere in your survey:

FieldDescription
ImageURL to the respondent’s profile photo
NameResolved full name
CityCity of residence
CountryCountry code
ValidWhether the email address is real and reachable
IsDefaultWhether the avatar is a fallback/generic image
Source.NameThe social network the data came from
RawDataThe complete JSON payload

Watch the Video Walkthrough

Before diving into the written steps, watch this complete tutorial — from configuring the Web Service element to rendering the avatar photo on a results page:


Step-by-Step Integration Guide

You can either follow these steps from scratch, or import the ready-made AvatarAPI.qsf template file directly into Qualtrics (see Step 8).


Step 1 — Get Your AvatarAPI Credentials

Sign up at avatarapi.com to obtain a username and password. A free demo account is available for evaluation — use the credentials demo / demo to test before going live.

The API endpoint you will call is:

https://avatarapi.com/v2/api.aspx

Step 2 — Create an Email Capture Question

In your Qualtrics survey, add a Text Entry question with a Single Line selector. This is where respondents will enter their email address.

Note the Question ID assigned to this question (e.g. QID3) — you will reference it when configuring the Web Service. You can find the QID by opening the question’s advanced options.

Tip: Add email format validation via Add Validation → Content Validation → Email to ensure the value passed to the API is always well-formed.


Step 3 — Add a Web Service Element to Your Survey Flow

Navigate to Survey Flow (the flow icon in the left sidebar). Click Add a New Element Here and choose Web Service. Position this element after the block containing your email question and before your results block.

Configure it as follows:

  • URL: https://avatarapi.com/v2/api.aspx
  • Method: POST
  • Content-Type: application/json

Step 4 — Set the Request Body Parameters

Under Set Request Parameters, switch to Specify Body Params and add these three key-value pairs:

{
"username": "your_username",
"password": "your_password",
"email": "${q://QID3/ChoiceTextEntryValue}"
}

The Qualtrics piped text expression ${q://QID3/ChoiceTextEntryValue} dynamically inserts whatever email the respondent typed. Replace QID3 with the actual QID of your email question if it differs.


Step 5 — Map the API Response to Embedded Data Fields

Scroll down to Map Fields from Response. Add one row for each field you want to capture. The From Response column is the JSON key returned by AvatarAPI; the To Field column is the Embedded Data variable name.

From Response (JSON key)To Field (Embedded Data)
ImageImage
NameName
ValidValid
CityCity
CountryCountry
IsDefaultIsDefault
Source.NameSource.Name
RawDataRawData

Note: Qualtrics stores these variables automatically — you don’t need to pre-declare them as Embedded Data elsewhere in the flow, though doing so in the survey flow header keeps things organised.


Step 6 — Display the Avatar Photo on a Results Page

Add a Descriptive Text / Graphic question in a block placed after the Web Service call in your flow.

In the rich-text editor, switch to the HTML source view and paste this snippet:

<img
src="${e://Field/Image}"
alt="Profile Picture"
style="width:100px; height:100px; border-radius:50%;"
/>

The expression ${e://Field/Image} inserts the profile photo URL at runtime. The border-radius: 50% gives it a circular crop for a polished appearance.

You can display other fields using the same pattern:

Name: ${e://Field/Name}
City: ${e://Field/City}
Country: ${e://Field/Country}
Source: ${e://Field/Source.Name}

Step 7 — Test with the Demo Account

Before going live, test the integration using the demo credentials. Enter a well-known email address (such as a Gmail address you know has a Google profile photo) to verify the image and data return correctly.

After a test submission, check the Survey Data tab — all mapped fields (Image, Name, City, Country, etc.) should appear as columns alongside your standard question responses.

Rate limits & production use: The demo credentials are shared and rate-limited. Swap in your own account credentials before publishing a live survey to ensure reliable performance.


Step 8 — Import the Ready-Made QSF Template

Rather than building from scratch, you can import the AvatarAPI.qsf file directly into Qualtrics. This gives you a pre-configured survey with the email question, Web Service flow, and image display block already set up.

To import: go to Create a new project → Survey → Import a QSF file and upload AvatarAPI.qsf. Then update the Web Service credentials to your own username and password, and you’re ready to publish.


How the Survey Flow Works

Once configured, your survey flow has this simple three-part structure:

  1. Block — Respondent enters their email address
  2. Web Service — Silent POST to avatarapi.com/v2/api.aspx; response fields mapped to Embedded Data
  3. Block — Results page displays the avatar photo and enriched profile data

The respondent experiences a seamless survey: they enter their email on page one, the API call fires silently between pages, and they see a personalised result — including their own profile photo — on page two.


Practical Use Cases

Lead enrichment surveys — Capture a prospect’s email and automatically resolve their name, city, and country without asking. Append this data to your CRM export from Qualtrics.

Event registration flows — Display the registrant’s photo back to them as a confirmation step, increasing engagement and reducing drop-off.

Email validation checkpoints — Use the Valid flag in a branch logic condition to route respondents with unresolvable addresses to a correction screen or alternative path.

Research panels — Enrich responses with geographic signals without asking respondents to self-report location, reducing survey length and improving data quality.


Get Started

  • API documentation & sign-up: avatarapi.com
  • API endpoint: https://avatarapi.com/v2/api.aspx
  • Demo credentials: username demo / password demo
  • Video tutorial: Watch on YouTube

Benchmarking reCAPTCHA v3 Solver Services: Speed vs Quality Analysis

When implementing automated systems that need to solve reCAPTCHA v3 challenges, choosing the right solver service can significantly impact both your success rate and operational costs. We conducted a comprehensive benchmark test of five popular reCAPTCHA v3 solving services to compare their performance in terms of both speed and quality scores.

The Results

We tested five major captcha solving services: CapSolver, 2Captcha, AntiCaptcha, NextCaptcha, and DeathByCaptcha. Each service was evaluated both with and without residential proxy support (using Decodo residential proxies).

Speed Performance Rankings

Fastest to Slowest (without proxy):

  1. CapSolver – 3,383ms (3.4 seconds)
  2. NextCaptcha – 6,725ms (6.7 seconds)
  3. DeathByCaptcha – 16,212ms (16.2 seconds)
  4. AntiCaptcha – 17,069ms (17.1 seconds)
  5. 2Captcha – 36,149ms (36.1 seconds)

With residential proxy:

  1. CapSolver – 5,101ms (5.1 seconds)
  2. NextCaptcha – 10,875ms (10.9 seconds)
  3. DeathByCaptcha – 10,861ms (10.9 seconds)
  4. 2Captcha – 25,749ms (25.7 seconds)
  5. AntiCaptcha – Failed (task type not supported with proxy)

Quality Score Results

Here’s where the results become particularly interesting: all services that successfully completed the challenge returned identical scores of 0.10. This uniformly low score across all providers suggests we’re observing a fundamental characteristic of how these services interact with Google’s reCAPTCHA v3 system rather than differences in solver quality.

What Do These Results Tell Us?

1. The Score Mystery

A reCAPTCHA v3 score of 0.10 is at the very bottom of Google’s scoring range (0.0-1.0), indicating that Google’s system detected these tokens as very likely originating from bots. This consistent result across all five services reveals several important insights:

Why such low scores?

  • reCAPTCHA v3 uses machine learning trained on actual site traffic patterns
  • Without established traffic history, the system defaults to suspicious scores
  • Commercial solver services are inherently detectable by Google’s sophisticated fingerprinting
  • The test environment may lack the organic traffic patterns needed for v3 to generate higher scores

As mentioned in our research, CleanTalk found that reCAPTCHA v3 often returns consistent scores in test environments without production traffic. The system needs time to “learn” what normal traffic looks like for a given site before it can effectively differentiate between humans and bots.

2. Speed is the Real Differentiator

Since all services returned the same quality score, speed becomes the primary differentiator:

CapSolver emerged as the clear winner, solving challenges in just 3.4 seconds without proxy and 5.1 seconds with proxy. This represents a 10x speed advantage over the slowest service (2Captcha at 36 seconds).

NextCaptcha came in second place with respectable times of 6.7 seconds (no proxy) and 10.9 seconds (with proxy), making it a solid middle-ground option.

DeathByCaptcha and AntiCaptcha performed similarly at around 16-17 seconds without proxy, though AntiCaptcha failed to support proxy-based solving for this captcha type.

2Captcha was significantly slower at 36 seconds without proxy, though it did improve to 25.7 seconds with proxy enabled.

3. Proxy Support Variations

Proxy support proved inconsistent across services:

  • Most services handled proxies well, with CapSolver, NextCaptcha, DeathByCaptcha, and 2Captcha all successfully completing challenges through residential proxies
  • AntiCaptcha failed with proxy, returning an “ERROR_TASK_NOT_SUPPORTED” error, suggesting their proxy-based reCAPTCHA v3 implementation may have limitations
  • Proxy impact on speed varied: Some services (2Captcha) were faster with proxy, while others (CapSolver, NextCaptcha) were slower

4. Success Rates

All services except AntiCaptcha (with proxy) achieved 100% success rates, meaning they reliably returned valid tokens. However, the validity of a token doesn’t correlate with its quality score—all tokens were valid but all received low scores from Google.

Practical Implications

For High-Volume Operations

If you’re processing thousands of captchas daily, CapSolver’s 3-5 second solve time provides a massive throughput advantage. At scale, this speed difference translates to:

  • Processing 1,000 captchas with CapSolver: ~56 minutes
  • Processing 1,000 captchas with 2Captcha: ~10 hours

For Quality-Sensitive Applications

The uniform 0.10 scores reveal a hard truth: commercial reCAPTCHA v3 solvers may not produce high-quality tokens that pass strict score thresholds. If your target site requires scores above 0.5 or 0.7, these services may not be suitable regardless of which one you choose.

Cost Considerations

Since all services returned the same quality, cost-per-solve becomes the tiebreaker alongside speed:

  • CapSolver: ~$1.00 per 1,000 solves
  • 2Captcha: ~$2.99 per 1,000 solves
  • AntiCaptcha: ~$2.00 per 1,000 solves

CapSolver offers the best speed-to-cost ratio in this comparison.

The Bigger Picture: reCAPTCHA v3 Limitations

These results illuminate a broader challenge with reCAPTCHA v3 solver services. Google’s v3 system is fundamentally different from v2:

  • v2 presented challenges that could be solved by humans or AI
  • v3 analyzes behavior patterns, browser fingerprints, and site-specific traffic history

Commercial solvers can generate valid tokens, but those tokens carry telltale signatures that Google’s machine learning readily identifies. The consistently low scores suggest that Google has effective detection mechanisms for solver-generated traffic.

When Might Scores Improve?

Based on research and documentation:

  1. Production environments with real organic traffic may see better scores
  2. Time – letting reCAPTCHA v3 “train” on a site for days or weeks
  3. Mixed traffic – solver tokens mixed with legitimate user traffic
  4. Residential proxies – though our test showed this alone doesn’t improve scores

Conclusions and Recommendations

If Speed Matters Most

Choose CapSolver. Its 3-5 second solve times are unmatched, and at $1 per 1,000 solves, it’s also the most cost-effective option.

If You Need Proxy Support

Avoid AntiCaptcha for proxy-based v3 solving. CapSolver, NextCaptcha, and DeathByCaptcha all handled residential proxies successfully.

If Quality Scores Matter

Reconsider using solver services entirely. The uniform 0.10 scores suggest that commercial solvers may not be suitable for sites with strict score requirements. Consider alternative approaches:

  • Browser automation with real user simulation
  • Residential proxy networks with actual human solvers
  • Challenging whether reCAPTCHA v3 is the right solution for your use case

The Bottom Line

For raw performance in a test environment, CapSolver dominated with the fastest solve times and lowest cost. However, the universal 0.10 quality scores across all services reveal that speed and cost may be moot points if your application requires high-quality scores that pass Google’s bot detection.

The real takeaway? reCAPTCHA v3 is doing its job—it successfully identifies solver-generated tokens regardless of which service you use. If you need high scores, you’ll need more sophisticated approaches than simply purchasing tokens from commercial solving services.


This benchmark was conducted in January 2026 using production API credentials for all services. Tests were performed with both direct connections and residential proxy infrastructure. Individual results may vary based on site configuration, traffic patterns, and Google’s evolving detection systems.

How to Set Up Your Own Custom Disposable Email Domain with Mailnesia

Disposable email addresses are incredibly useful for maintaining privacy online, avoiding spam, and testing applications. While services like Mailnesia offer free disposable emails, there’s an even more powerful approach: using your own custom domain with Mailnesia’s infrastructure.

Why Use Your Own Domain?

When you use a standard disposable email service, the domain (like @mailnesia.com) is publicly known. This means:

  • Websites can easily block known disposable email domains
  • There’s no real uniqueness to your addresses
  • You’re sharing the domain with potentially millions of other users

By pointing your own domain to Mailnesia, you get:

  • Higher anonymity – Your domain isn’t in any public disposable email database
  • Unlimited addresses – Create any email address on your domain instantly
  • Professional appearance – Use a legitimate-looking domain for sign-ups
  • Better deliverability – Less likely to be flagged as a disposable email

What You’ll Need

  • A domain name you own (can be purchased for as little as $10/year)
  • Access to your domain’s DNS settings
  • That’s it!

Step-by-Step Setup

1. Access Your DNS Settings

Log into your domain registrar or DNS provider (e.g., Cloudflare, Namecheap, GoDaddy) and navigate to the DNS management section for your domain.

2. Add the MX Record

Create a new MX (Mail Exchange) record with these values:

Type: MX
Name: @ (or leave blank for root domain)
Mail Server: mailnesia.com
Priority/Preference: 10
TTL: 3600 (or default)

Important: Make sure to include the trailing dot if your DNS provider requires it: mailnesia.com.

3. Wait for DNS Propagation

DNS changes can take anywhere from a few minutes to 48 hours to fully propagate, though it’s usually quick (under an hour). You can check if your MX record is live using a DNS lookup tool.

4. Start Using Your Custom Disposable Emails

Once the DNS has propagated, any email sent to any address at your domain will be received by Mailnesia. Access your emails by going to:

https://mailnesia.com/mailbox/USERNAME

Where USERNAME is the part before the @ in your email address.

For example:

  • Email sent to: testing123@yourdomain.com
  • Access inbox at: https://mailnesia.com/mailbox/testing123

Use Cases

This setup is perfect for:

  • Service sign-ups – Use a unique email for each service (e.g., netflix@yourdomain.com, github@yourdomain.com)
  • Testing – Developers can test email functionality without setting up mail servers
  • Privacy protection – Keep your real email address private
  • Spam prevention – If an address gets compromised, simply stop using it
  • Tracking – See which services sell or leak your email by using unique addresses per service

Important Considerations

Security and Privacy

  • No authentication required – Anyone who guesses or knows your username can access that mailbox. Don’t use this for sensitive communications.
  • Temporary storage – Mailnesia emails are not stored permanently. They’re meant to be disposable.
  • No sending capability – This setup only receives emails; you cannot send from these addresses through Mailnesia.

Best Practices

  1. Use random usernames – Instead of newsletter@yourdomain.com, use something like j8dk3h@yourdomain.com for better privacy
  2. Subdomain option – Consider using a subdomain like disposable.yourdomain.com to keep it separate from your main domain
  3. Don’t use for important accounts – Reserve this for non-critical services only
  4. Monitor your usage – Keep track of which addresses you’ve used where

Technical Notes

  • You can still use your domain for regular email by setting up additional MX records with different priorities
  • Some providers may allow you to set up email forwarding in addition to this setup
  • Check Mailnesia’s terms of service for any usage restrictions

Verifying Your Setup

To test if everything is working:

  1. Send a test email to a random address at your domain (e.g., test12345@yourdomain.com)
  2. Visit https://mailnesia.com/mailbox/test12345
  3. Your email should appear within a few seconds

Troubleshooting

Emails not appearing?

  • Verify your MX record is correctly set up using an MX lookup tool
  • Ensure DNS has fully propagated (can take up to 48 hours)
  • Check that you’re using the correct mailbox URL format

Getting bounced emails?

  • Make sure the priority is set to 10 or lower
  • Verify there are no conflicting MX records

Conclusion

Setting up your own custom disposable email domain with Mailnesia is surprisingly simple and provides a powerful privacy tool. With just a single DNS record change, you gain access to unlimited disposable email addresses on your own domain, giving you greater control over your online privacy and reducing spam in your primary inbox.

The enhanced anonymity of using your own domain, combined with the zero-configuration convenience of Mailnesia’s infrastructure, makes this an ideal solution for anyone who values their privacy online.


Remember: This setup is for non-sensitive communications only. For important accounts, always use a proper email service with security features like two-factor authentication.

Unlock Brand Recognition in Emails: Free #BIMI #API from AvatarAPI.com

https://www.avatarapi.com/

Email marketing is more competitive than ever, and standing out in crowded inboxes is a constant challenge. What if there was a way to instantly make your emails more recognizable and trustworthy? Enter BIMI – a game-changing email authentication standard that’s revolutionizing how brands appear in email clients.

What is BIMI? (In Simple Terms)

BIMI stands for “Brand Indicators for Message Identification.” Think of it as a verified profile picture for your company’s emails. Just like how you recognize friends by their profile photos on social media, BIMI lets email providers display your company’s official logo next to emails you send.

Here’s how it works in everyday terms:

  • Traditional email: When Spotify sends you an email, you might only see their name in your inbox
  • BIMI-enabled email: You’d see Spotify’s recognizable logo right next to their name, making it instantly clear the email is legitimate

This visual verification helps recipients quickly identify authentic emails from brands they trust, while making it harder for scammers to impersonate legitimate companies.

Why BIMI Matters for Your Business

Instant Brand Recognition: Your logo appears directly in the inbox, increasing brand visibility and email open rates.

Enhanced Trust: Recipients can immediately verify that emails are genuinely from your company, reducing the likelihood they’ll mark legitimate emails as spam.

Competitive Advantage: Many companies haven’t implemented BIMI yet, so adopting it early helps you stand out.

Better Deliverability: Email providers like Gmail and Yahoo prioritize authenticated emails, potentially improving your delivery rates.

Introducing the Free BIMI API from AVATARAPI.com

While implementing BIMI traditionally requires DNS configuration and technical setup, AVATARAPI.com offers a simple API that lets you retrieve BIMI information for any email domain instantly. This is perfect for:

  • Email marketing platforms checking sender authenticity
  • Security tools validating email sources
  • Analytics services tracking BIMI adoption
  • Developers building email-related applications

How to Use the Free BIMI API

Getting started is incredibly simple. Here’s everything you need to know:

API Endpoint

POST https://avatarapi.com/v2/api.aspx

Request Format

Send a JSON request with these parameters:

{
    "username": "demo",
    "password": "demo___",
    "provider": "Bimi",
    "email": "no-reply@alerts.spotify.com"
}

Parameters Explained:

  • username & password: Use “demo” and “demo___” for free access
  • provider: Set to “Bimi” to retrieve BIMI data
  • email: The email address you want to check for BIMI records

Example Response

The API returns comprehensive BIMI information:

{
    "Name": "",
    "Image": "https://message-editor.scdn.co/spotify_ab_1024216054.svg",
    "Valid": true,
    "City": "",
    "Country": "",
    "IsDefault": false,
    "Success": true,
    "RawData": "",
    "Source": {
        "Name": "Bimi"
    }
}

Response Fields:

  • Image: Direct URL to the company’s BIMI logo
  • Valid: Whether the BIMI record is properly configured
  • Success: Confirms the API call was successful
  • IsDefault: Indicates if this is a fallback or authentic BIMI record

Practical Use Cases

Email Security Platforms: Verify sender authenticity by checking if incoming emails have valid BIMI records.

Marketing Analytics: Track which competitors have implemented BIMI to benchmark your email marketing efforts.

Email Client Development: Integrate BIMI logo display into custom email applications.

Compliance Monitoring: Ensure your company’s BIMI implementation is working correctly across different domains.

Try It Now

Ready to explore BIMI data? The API is free to use with the demo credentials provided above. Simply make a POST request to test it with any email address – try major brands like Spotify, PayPal, or LinkedIn to see their BIMI implementations in action.

Whether you’re a developer building email tools, a marketer researching competitor strategies, or a security professional validating email authenticity, this free BIMI API provides instant access to valuable brand verification data.

Start integrating BIMI checking into your applications today and help make email communication more secure and recognizable for everyone.
https://www.avatarapi.com/

How to Use the Car Rego API in WordPress

In this tutorial, we’ll walk through how to integrate the Car Registration API into a WordPress site. This method ensures that your username and API key are not publicly exposed.

Tools Used in This Demo

  1. WordPress
  2. Code Snippets (Free plugin)
  3. Elementor Pro (Paid website builder)

We’ll be using both PHP and JavaScript scripts. While there are multiple ways to accomplish this, the approach described here prioritizes security by keeping sensitive credentials hidden.


Step 1: Register for the API

Visit carregistrationapi.com and create an account to get your username/API key.


Step 2: Add the PHP Script

Use the Code Snippets plugin to add the PHP code. Paste the script into a new snippet and activate it.

🔁 Important: Replace the placeholder on line 16 with your actual username from Step 1.

add_action('elementor_pro/forms/new_record', function($record, $handler) {
    if (!session_id()) session_start();

    // ✅ Confirm hook fired
    //file_put_contents(WP_CONTENT_DIR . '/uploads/rego-debug.txt', "HOOK FIRED\n", FILE_APPEND);
    //check https://abc.com.au/wp-content/uploads/rego-debug.txt

    $form_id = $record->get_form_settings('form_id');
    if ('regoform' !== $form_id) return;

    //file_put_contents(WP_CONTENT_DIR . '/uploads/rego-debug.txt', "Form matched: $form_id\n", FILE_APPEND);

    $fields = $record->get('fields');
    $rego  = $fields['rego']['value'] ?? '';
    $state = $fields['state']['value'] ?? '';
    $username = 'ABC';

    $api_url = add_query_arg([
        'RegistrationNumber' => $rego,
        'State'              => $state,
        'username'           => $username,
    ], 'https://www.regcheck.org.uk/api/reg.asmx/CheckAustralia');

    // 🔍 API call
    $response = wp_remote_get($api_url);

    // ✅ ADD LOGGING BLOCK HERE
    //file_put_contents(WP_CONTENT_DIR . '/uploads/rego-debug.txt', "API URL: $api_url\n", FILE_APPEND);

    if (is_wp_error($response)) {
        $error_message = $response->get_error_message();
        file_put_contents(WP_CONTENT_DIR . '/uploads/rego-debug.txt', "API Error: $error_message\n", FILE_APPEND);
    } else {
        $body = wp_remote_retrieve_body($response);
        //file_put_contents(WP_CONTENT_DIR . '/uploads/rego-debug.txt', "API Response: $body\n", FILE_APPEND);

        // Parse response
        $xml = @simplexml_load_string($body);
        $vehicleJson = (string) ($xml->vehicleJson ?? '');
        $vehicleData = json_decode($vehicleJson, true);

        $_SESSION['rego_result'] = [
            'Description' => $vehicleData['Description'] ?? 'N/A',
            'Year'        => $vehicleData['RegistrationYear'] ?? 'N/A',
            'Engine'      => $vehicleData['Engine'] ?? 'N/A',
        ];
    }
}, 10, 2);

// Shortcode to display result
add_shortcode('rego_vehicle_info', function() {
    if (!session_id()) session_start();
	
	//$log_path = WP_CONTENT_DIR . '/uploads/rego-debug.txt';

    // Log shortcode execution
    //file_put_contents($log_path, "SHORTCODE TRIGGERED\n", FILE_APPEND);
	
    $data = $_SESSION['rego_result'] ?? null;

    if (!$data) {
        return '<p>No vehicle information available yet.</p>';
    }
	
    //file_put_contents($log_path, "Session Data: " . print_r($data, true) . "\n", FILE_APPEND);
	
    ob_start();
    ?>
    <div class="rego-vehicle-info">
        <h3>Vehicle Details</h3>
        <ul>
            <li><strong>Description:</strong> <?= esc_html($data['Description']) ?></li>
            <li><strong>Registration Year:</strong> <?= esc_html($data['Year']) ?></li>
            <li><strong>Engine:</strong> <?= esc_html($data['Engine']) ?></li>
        </ul>
    </div>
    <?php
    return ob_get_clean();
});

add_action('rest_api_init', function() {
    register_rest_route('rego/v1', '/data', [
        'methods' => 'GET',
        'callback' => function() {
            if (!session_id()) session_start();
            return $_SESSION['rego_result'] ?? ['error' => 'No data in session'];
        },
        'permission_callback' => '__return_true'
    ]);
});

Step 3: Create the Form and Layout on Your Website

a) Create the Form (Using Elementor or similar)

Structure your form with the following settings:

  • Form ID: regoform
  • Form Name: regoform
  • Rego Field:
    • ID: rego
    • Shortcode: [field id="rego"]
  • State Field:
    • ID: state
    • Shortcode: [field id="state"]

These field IDs will be referenced in the PHP and JavaScript scripts.

b) Add HTML Widgets

Use two separate HTML widgets in Elementor:

  1. For Displaying the Result:
    Add this HTML element: <div id="rego-result-container"></div>
  2. For the JavaScript Logic:
    Add the JavaScript snippet (you can remove or comment out any log messages if not needed).
<script>
window.addEventListener('load', function () {
    function waitForjQueryAndForm() {
        if (typeof jQuery === 'undefined') {
            console.log("⏳ Waiting for jQuery...");
            setTimeout(waitForjQueryAndForm, 100);
            return;
        }

        jQuery(function ($) {
            const $form = $('#regoform');

            if (!$form.length) {
                console.log("⏳ Waiting for form #regoform to appear...");
                setTimeout(waitForjQueryAndForm, 100);
                return;
            }

            console.log("✅ Found form #regoform");

            // Listen for form success response from Elementor Pro
            $form.on('submit_success', function () {
                console.log("✅ Form #regoform successfully submitted via AJAX");

                setTimeout(function () {
                    $.ajax({
                        url: '/wp-json/rego/v1/data',
                        method: 'GET',
                        success: function (data) {
                            console.log("✅ API response:", data);

                            if (data && !data.error) {
                                const html = `
                                    <div class="rego-vehicle-info">
                                        <h3>Vehicle Details</h3>
                                        <ul>
                                            <li><strong>Description:</strong> ${data.Description}</li>
                                            <li><strong>Registration Year:</strong> ${data.Year}</li>
                                            <li><strong>Engine:</strong> ${data.Engine}</li>
                                        </ul>
                                    </div>
                                `;
                                $('#rego-result-container').html(html);
                            } else {
                                $('#rego-result-container').html('<p>No vehicle info available.</p>');
                            }
                        },
                        error: function () {
                            $('#rego-result-container').html('<p>Failed to load vehicle info.</p>');
                        }
                    });
                }, 1000);
            });
        });
    }

    waitForjQueryAndForm();
});
</script>

How the Flow Works

  1. The user fills out the form and clicks the “Send” button.
  2. The form captures the rego and state values.
  3. The PHP script listens for the form action, calls the API, and fetches the results.
  4. The JavaScript reads the result and displays the data dynamically on the page.

Example

Here’s a basic demo in action

How to Query #LinkedIn from an #Email Address Using AvatarAPI.com

Introduction

When working with professional networking data, LinkedIn is often the go-to platform for retrieving user information based on an email address. Using AvatarAPI.com, developers can easily query LinkedIn and other data providers through a simple API request. In this guide, we’ll explore how to use the API to retrieve LinkedIn profile details from an email address.

API Endpoint

To query LinkedIn using AvatarAPI.com, send a request to:

https://avatarapi.com/v2/api.aspx

JSON Payload

A sample JSON request to query LinkedIn using an email address looks like this:

{
    "username": "demo",
    "password": "demo___",
    "provider": "LinkedIn",
    "email": "jason.smith@gmail.com"
}

Explanation of Parameters:

  • username: Your AvatarAPI.com username.
  • password: Your AvatarAPI.com password.
  • provider: The data source to query. In this case, “LinkedIn” is specified. If omitted, the API will search a default set of providers.
  • email: The email address for which LinkedIn profile data is being requested.

API Response

A successful response from the API may look like this:

{
    "Name": "Jason Smith",
    "Image": "https://media.licdn.com/dms/image/D4E12AQEud3Ll5MI7cQ/article-inline_image-shrink_1500_2232/0/1660833954461?e=1716422400&v=beta&t=r-9LmmNBpvS4bUiL6k-egJ8wUIpEeEMl9NJuAt7pTsc",
    "Valid": true,
    "City": "Los Angeles, California, United States",
    "Country": "US",
    "IsDefault": false,
    "Success": true,
    "RawData": "{\"resultTemplate\":\"ExactMatch\",\"bound\":false,\"persons\":[{\"id\":\"urn:li:person:DgEdy8DNfhxlX15HDuxWp7k6hYP5jIlL8fqtFRN7YR4\",\"displayName\":\"Jason Smith\",\"headline\":\"Creative Co-founder at Mega Ventures\",\"summary\":\"Jason Smith Head of Design at Mega Ventures.\",\"companyName\":\"Mega Ventures\",\"location\":\"Los Angeles, California, United States\",\"linkedInUrl\":\"https://linkedin.com/in/jason-smith\",\"connectionCount\":395,\"skills\":[\"Figma (Software)\",\"Facebook\",\"Customer Service\",\"Event Planning\",\"Social Media\",\"Sales\",\"Healthcare\",\"Management\",\"Web Design\",\"JavaScript\",\"Software Development\",\"Project Management\",\"APIs\"]}]}",
    "Source": {
        "Name": "LinkedIn"
    }
}

Explanation of Response Fields:

  • Name: The full name of the LinkedIn user.
  • Image: The profile image URL.
  • Valid: Indicates whether the returned data is valid.
  • City: The city where the user is located.
  • Country: The country of residence.
  • IsDefault: Indicates whether the data is a fallback/default.
  • Success: Confirms if the request was successful.
  • RawData: Contains additional structured data about the LinkedIn profile, including:
    • LinkedIn ID: A unique identifier for the user’s LinkedIn profile.
    • Display Name: The name displayed on the user’s profile.
    • Headline: The professional headline, typically the current job title or a short description of expertise.
    • Summary: A brief bio or description of the user’s professional background.
    • Company Name: The company where the user currently works.
    • Location: The geographical location of the user.
    • LinkedIn Profile URL: A direct link to the user’s LinkedIn profile.
    • Connection Count: The number of LinkedIn connections the user has.
    • Skills: A list of skills associated with the user’s profile, such as programming languages, software expertise, or industry-specific abilities.
    • Education History: Details about the user’s academic background, including universities attended, degrees earned, and fields of study.
    • Employment History: Information about past and present positions, including company names, job titles, and employment dates.
    • Projects and Accomplishments: Notable work the user has contributed to, certifications, publications, and other professional achievements.
    • Endorsements: Skill endorsements from other LinkedIn users, showcasing credibility in specific domains.
  • Source.Name: The data provider (LinkedIn in this case).

LinkedIn Rate Limiting

By default, LinkedIn queries are subject to rate limits. To bypass these limits, additional parameters can be included in the JSON request:

{
    "overrideAccount": "your_override_username",
    "overridePassword": "your_override_password"
}

Using these credentials allows queries to be processed without rate limiting. However, to enable this feature, you should contact AvatarAPI.com to discuss setup and access.

Conclusion

AvatarAPI.com provides a powerful way to retrieve LinkedIn profile data using just an email address. While LinkedIn is one of the available providers, the API also supports other data sources if the provider field is omitted. With proper setup, including rate-limit bypassing credentials, you can ensure seamless access to professional networking data.

For more details, visit AvatarAPI.com.