# Using Wolfram|Alpha API in Websites?

**URL:** <https://community.wolfram.com/t/using-wolfram-alpha-api-in-websites/9209>\
**Category:** Questions\
**Tags:** computer-science, software-development, wolfram-alpha, curated-data, interface-construction\
**Created:** [September 5, 2016, 5:35pm UTC](https://community.wolfram.com/t/using-wolfram-alpha-api-in-websites/9209 "2016-09-05T17:35:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sjkyv5](https://avatars.discourse-cdn.com/v4/letter/s/a88e57/32.png) [@sjkyv5](https://community.wolfram.com/u/sjkyv5)\
**Post date:** [September 5, 2016, 5:35pm UTC](https://community.wolfram.com/t/using-wolfram-alpha-api-in-websites/9209/1 "2016-09-05T17:35:27Z")

</div>

Hi everyone,

I would like to use the wolfram API on my website, but Wolfram does not have CORS enabled. Does anyone know how to get around this. Would Wolfram consider turning this on Header set Access-Control-Allow-Origin “\*” . I posted a question here as well:

[http://stackoverflow.com/questions/39320637](http://stackoverflow.com/questions/39320637)

Best,  
Seth

* * *

## P.S. Copy of stackoverflow question:

I am trying to query wolfram to do some math for my site and then display the result. I am having trouble with CORS.  
My Code:

```
var xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function() { 
  if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
     callback(xmlHttp.responseText);
}
xmlHttp.open("GET", "http://api.wolframalpha.com/v2/query?input="+theUrl+"&appid=", true); // true for asynchronous 
xmlHttp.send(null);

```

My Error:

“Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at [http://api.wolframalpha.com/v2/query?input=sqrt(100)&appid=](http://api.wolframalpha.com/v2/query?input=sqrt(100)&appid=). (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).”

I understand that on a dynamic site I could just add

```
Header set Access-Control-Allow-Origin "*"

```

to .htaccess

but I’m not sure how to do it on a static site. I have read that Allow-Access\_origin should already be present in github pages.

2nd answer here: [http://stackoverflow.com/questions/26416727](http://stackoverflow.com/questions/26416727)

2nd answer here: [http://stackoverflow.com/questions/18923328](http://stackoverflow.com/questions/18923328)
