title: curl query to Facebook FQL requires auth?
body: <p>I used curl to query Facebook's FQL and this happened: </p>
  
  <pre><code>&gt; curl 'https://api.facebook.com/method/fql.query' -d "query=SELECT+now()+FROM+user+WHERE+name='Barry Carter';" 
  
  &lt;?xml version="1.0" encoding="UTF-8"?&gt; 
  &lt;error_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd"&gt; 
    &lt;error_code&gt;102&lt;/error_code&gt; 
    &lt;error_msg&gt;Session key invalid or no longer valid&lt;/error_msg&gt; 
    &lt;request_args list="true"&gt; 
      &lt;arg&gt; 
        &lt;key&gt;method&lt;/key&gt; 
        &lt;value&gt;fql.query&lt;/value&gt; 
      &lt;/arg&gt; 
      &lt;arg&gt; 
        &lt;key&gt;query&lt;/key&gt; 
        &lt;value&gt;SELECT now() FROM user WHERE name='Barry Carter';&lt;/value&gt; 
      &lt;/arg&gt; 
    &lt;/request_args&gt; 
  &lt;/error_response&gt; 
  </code></pre>
  
  <p>Do I need to authenticate even to find users? On the website, you can 
  do that sans authentication? </p>
  
  <p>If I do need authentication, how do I get it? I've read 
  <a href="http://developers.facebook.com/docs/authentication" rel="nofollow noreferrer">http://developers.facebook.com/docs/authentication</a> but do I need all 
  that for a simple curl call? If so, what should I do to get an auth 
  token? Do I need to store cookies/etc (using curl's -b and -c flags?). </p>
  
  <p>This question is similar to 
  <a href="https://stackoverflow.com/questions/2683452/facebook-api-fql-query-invalid-session">Facebook API - fql_query, Invalid session</a> 
  but I'm using straight curl, not PHP. </p>
  
  <p>I realize the query should be GET, not POST, but I'm pretty sure that's not the problem.</p>