Ask Dave Taylor
  • Facebook
  • Instagram
  • Linkedin
  • Pinterest
  • Twitter
  • YouTube
  • Home
  • Videos
  • Most Popular
  • Top Categories
  • Books
  • About Dave
  • Ask Me
  • > Donate <
  • Home
  • HTML & Web Page Design
  • Can I Add a Khan Academy Search Box to my Web Site?

Can I Add a Khan Academy Search Box to my Web Site?

February 19, 2021 / Dave Taylor / HTML & Web Page Design / No Comments

I’ve been building out a homeschool resource Web site and am wondering if there’s any way I can either link to specific search results on Khan Academy or even embed a search box directly on my own page?

Khan Academy has a well deserved reputation as a terrific resource both for homeschool students and anyone else who wants to access lots of interesting talks and presentations. What you might not realize is the origin of its name. It’s not, in fact, named after Genghis Khan, it’s the brainchild of Sal Khan. As the story goes, “the site started in 2006 when Salman “Sal” Khan tutored one of his cousins in mathematics on the Internet using a service called Yahoo! Doodle Images. After a while, Khan’s other cousins began to use his tutoring service.”

The Khan Academy site has two different search systems, which makes it a bit puzzling to try and reverse engineer the results so you can link directly to the search output or add a search box to your own site, but we can overcome! The good news is that the site hasn’t eschewed the more traditional type of search where the search pattern is in the resultant URL. That’s our key.

To start out, let’s just have a peek at the Khan Academy home page:

khan academy home page

The key box is on the top left: Search.

Type in a word, phrase or concept – I’ll use “lego” for my examples – and it’ll immediately show you results on the same page:

khan academy search reverse engineer - embedded search results

Have a look at the URL in the address bar and it hasn’t changed. Hmm…

But here’s the secret: With that same search term in the search box, end by pressing Return or Enter. After a moment, you’ll get to a new Web page with the search results:

khan academy search reverse engineer - new page search results

The URL shown in this instance is:

https://www.khanacademy.org/search?referer=%2F&page_search_query=lego

Now that’s enough for us to work with…

HOW TO REVERSE ENGINEER THE KHAN ACADEMY SEARCH

I like to experiment to figure out which of the name=value pairs in the search results URL are really required, and it’s a pretty quick test to verify that the referer is unneeded (and misspelled too, ironically!). So, in fact, here’s the minimal search results page URL:

https://www.khanacademy.org/search?page_search_query=lego

In fact, that’s the link for the “lego” search results page. Click to see for yourself: Content related to LEGO on Khan Academy.

You can produce a link for any search results based on that, just keep in mind that spaces in your search term should be replaced with a “+”. So a few examples: The Declaration of Independence and evolution.

Cool, right?

Now, what if you want to build your own search box? With just a smidge of HTML knowledge it’s easy to unwrap the search results URL into the fields required for an HTML search form:

action=https://www.khanacademy.org/search
method=get
page_search_query=search

In other words:

<form action="https://www.khanacademy.org/search" method="get">
   <input type="text" name="page_search_query" />
   <input type="submit" value="Search Khan Academy" />
</form>

Really, that’s it. Here’s the form, ready for you to test out:

Try using the search box above. If you’re drawing a blank, search for ‘potatoes’. Pretty darn easy, isn’t it? And that’s it. Just carefully copy and paste the above four lines of HTML onto your own Web page and you’ll have a Khan Academy search ready for your visitors to use.

Pro Tip: I’ve been writing about HTML and reverse engineering things like search boxes for quite a while. Please check out my extensive HTML help area for lots more fun and interesting tutorials! Thanks.

Let’s Stay In Touch!

Never miss a single article, review or tutorial here on AskDaveTaylor, sign up for my fun weekly newsletter!
Name: 
Your email address:*
Please enter all required fields
Correct invalid entries
No spam, ever. Promise. Powered by FeedBlitz
Please choose a color:
Starbucks coffee cup I do have a lot to say, and questions of my own for that matter, but first I'd like to say thank you, Dave, for all your helpful information by buying you a cup of coffee!
html form, khan academy, khan academy search box, reverse engineering, search form, search url

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search

Recent Posts

  • How Can I Prevent Remote Access to my Windows PC?
  • The Easy Way to Add Contacts to my New Android Phone?
  • How Can I Hide or Report An Offensive Advert on Facebook?
  • Switch “Paste” & “Paste and Match Style” Keyboard Shortcuts on MacOS?
  • How Can I Easily Create a QR Code For My Web Page?

On Our YouTube Channel

AUKEY Omnia 100W + Minima 20W Power Chargers -- DEMO & REVIEW

Roborock S6 MaxV Robot Vacuum Cleaner -- DEMO & REVIEW

Categories

  • AdSense, AdWords, and PPC Help (106)
  • Amazon Echo & Kindle Help (79)
  • Amazon, eBay, and Online Shopping Help, (157)
  • Android Help (160)
  • Apple Watch Help (49)
  • Articles, Tutorials, and Reviews (327)
  • Business Advice (192)
  • Computer & Internet Basics (720)
  • d) None of the Above (160)
  • Facebook Help (365)
  • Google, Chrome & Gmail Help (157)
  • HTML & Web Page Design (244)
  • Instagram Help (44)
  • iPad Help (137)
  • iPhone & iOS Help (571)
  • iPod & MP3 Player Help (173)
  • LinkedIn Help (79)
  • Linux Help (149)
  • Linux Shell Script Programming (86)
  • Mac & MacOS Help (833)
  • Most Popular (10)
  • Outlook & Office 365 Help (10)
  • PayPal Help (68)
  • Pinterest Help (53)
  • Reddit Help (12)
  • SEO & Marketing (80)
  • Spam, Scams & Security (84)
  • Trade Show News & Updates (23)
  • Twitter Help (212)
  • Video Game Tips (66)
  • Web Site Traffic Tips (62)
  • Windows 10 Help (831)
  • Wordpress Help (201)
  • Writing and Publishing (72)
  • YouTube Help (43)
  • YouTube Video Reviews (159)
  • Zoom, Skype & Video Chat Help (42)

Archives

Social Connections:

Ask Dave Taylor


Follow Me on Pinterest
Follow me on Twitter
Follow me on LinkedIn
Follow me on Instagram


AskDaveTaylor on Facebook



microsoft insider mvp


This web site is for the purpose of disseminating information for educational purposes, free of charge, for the benefit of all visitors. We take great care to provide quality information. However, we do not guarantee, and accept no legal liability whatsoever arising from or connected to, the accuracy, reliability, currency or completeness of any material contained on this site or on any linked site. Further, please note that by submitting a question or comment you're agreeing to our terms of service, which are: you relinquish any subsequent rights of ownership to your material by submitting it on this site. Our lawyer says "Thanks for your cooperation."
© 2020 by Dave Taylor. "Ask Dave Taylor®" is a registered trademark of Intuitive Systems, LLC.
Privacy Policy - Terms and Conditions - Accessibility Policy