Thanks for the great suggestions (Nick, Nick, and Eric)!
Here are the two functions that finally do what I wanted. I added the second function to get a specific result.
#+RANDOM: tfjkdsla jfkdsa
#+BEGIN_SRC emacs-lisp :results value
; suggested by Nicolas Goaziou <n.goaziou@gmail.com>
(defun jk-org-kwds ()
(org-element-map (org-element-parse-buffer 'element) 'keyword
(lambda (keyword) (cons (org-element-property :key keyword)
(org-element-property :value keyword)))))
(defun jk-org-kwd (KEYWORD)
"get the value of a KEYWORD in the form of #+KEYWORD: value"
(cdr (assoc KEYWORD (jk-org-kwds))))
(jk-org-kwd "RANDOM")
#+END_SRC
#+RESULTS:
: tfjkdsla jfkdsa
A less orgish way I worked out last night after browsing through org.el is:
#+ANDREWID: jkitchin
#+BEGIN_SRC emacs-lisp :results value
(defun jk-get-file-keyword (KEYWORD)
"get the value from a line like this
#+OPTION: value
in a file."
(interactive)
(let ((case-fold-search t)
(re (format "^#\\+%s:[ \t]+\\([^\t\n]+\\)" KEYWORD)))
(if (not (save-excursion
(or (re-search-forward re nil t)
(re-search-backward re nil t))))
(error (format "No line containing #+%s: value found" KEYWORD)))
(match-string 1)))
(jk-get-file-keyword "ANDREWID")
#+END_SRC
#+RESULTS:
: jkitchin
This is pretty awesome!