Ask Dave Taylor
  • Facebook
  • Instagram
  • Linkedin
  • Pinterest
  • Twitter
  • YouTube
  • Home
  • YouTube Videos
  • Top Categories
  • Subscribe via Email
  • Ask A Question
  • Meet Dave
  • 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.

About the Author: Dave Taylor has been involved with the online world since the early days of the Internet. Author of over 20 technical books, he runs the popular AskDaveTaylor.com tech help site. You can also find his gadget reviews on YouTube and chat with him on Twitter as @DaveTaylor.

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

  • Guide to Setting Up Gmail for Offline Use (Just In Case)
  • Can I Fill Out & Sign PDFs on my Chromebook?
  • How Can I Get Pinch to Zoom Working on my MacBook Air?
  • How to Save Phone Battery Life with Adaptive Connectivity?
  • Join the Microsoft Edge Beta Program, Get AI-Powered Bing!

On Our YouTube Channel

1More Sonoflow Hi-Res Audio Headphones -- DEMO & REVIEW

EKSA E1000WT 2.4Ghz Wireless Gaming Headset -- DEMO & REVIEW

Categories

  • AdSense, AdWords, and PPC Help (106)
  • Amazon, eBay, and Online Shopping Help (164)
  • Android Help (230)
  • Apple iPad Help (149)
  • Apple Watch Help (53)
  • Articles, Tutorials, and Reviews (346)
  • Auto Tech Help (17)
  • Business Advice (200)
  • ChromeOS Help (35)
  • Computer & Internet Basics (783)
  • d) None of the Above (166)
  • Facebook Help (384)
  • Google, Chrome & Gmail Help (189)
  • HTML & Web Page Design (247)
  • Instagram Help (49)
  • iPhone & iOS Help (627)
  • iPod & MP3 Player Help (173)
  • Kindle & Nook Help (99)
  • LinkedIn Help (88)
  • Linux Help (174)
  • Linux Shell Script Programming (90)
  • Mac & MacOS Help (916)
  • Most Popular (16)
  • Outlook & Office 365 Help (34)
  • PayPal Help (68)
  • Pinterest Help (54)
  • Reddit Help (19)
  • SEO & Marketing (82)
  • Spam, Scams & Security (97)
  • Trade Show News & Updates (23)
  • Twitter Help (222)
  • Video Game Tips (66)
  • Web Site Traffic Tips (62)
  • Windows PC Help (953)
  • Wordpress Help (206)
  • Writing and Publishing (72)
  • YouTube Help (47)
  • YouTube Video Reviews (159)
  • Zoom, Skype & Video Chat Help (62)

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."
© 2023 by Dave Taylor. "Ask Dave Taylor®" is a registered trademark of Intuitive Systems, LLC.
Privacy Policy - Terms and Conditions - Accessibility Policy