Skip to content

Instantly share code, notes, and snippets.

@imshashank
Last active August 29, 2015 14:01
Show Gist options
  • Save imshashank/a9621acc6efd2dd16701 to your computer and use it in GitHub Desktop.
Save imshashank/a9621acc6efd2dd16701 to your computer and use it in GitHub Desktop.

#Web Service for accessing OAAC Corpus

The following methods can be used to access the OAC Corpus.

####Get Method All requests have to be GET requests.

url:http://api.open-academia.org/

####GET /get_articles/ Get a list of all articles starting from "start" location and limited by "count" If the "start" is not given, the API by default returns the first 30 articles.

  method:       GET
  url:          http://api.open-academia.org/get_articles/
  start:        int //the offset from start in index
  count:        int //the number of records to return

####GET /get_article_by_alternate_id/ Get article with the specific "alternate_id"

  method:       GET
  url:          http://api.open-academia.org/get_article_by_alternate_id/{alternate_id}
  alternate_id: varchar //The unique id from the OAAC

####GET /get_article_by_id/ Get article with the specific "article_id"

  method:       GET
  url:          http://api.open-academia.org/get_article_by_id/{article_id}
  article_id:   int //A Unique ID assigned to every article

####GET /get_author_ids/ Get author_ids that belong to the specified "article_id"

  method:       GET
  url:          http://api.open-academia.org/get_author_ids/{article_id}
  article_id:   int //A Unique ID assigned to every article

####GET /get_author_names/ Get the author's name with the specified "author_id"

  method:       GET
  url:          http://api.open-academia.org/get_author_names/{author_id}
  author_id:    int //A Unique ID assigned to every author

####GET /get_authors/ Get a list of author_name associated with the specified "article_id"

  method:       GET
  url:          http://api.open-academia.org/get_authors/{article_id}
  article_id:   int //A Unique ID assigned to every article

####GET /get_articles_by_author/ Get a list of article_ids associated with the specified "author_id"

  method:       GET
  url:          http://api.open-academia.org/get_articles_by_author/{author_id}
  author_id:    int //A Unique ID assigned to every author

####GET /get_journal_id/ Get journal id associated with the specified "article_id"

  method:       GET
  url:          http://api.open-academia.org/get_journal_id/{article_id}
  article_id:   int //A Unique ID assigned to every article

####GET /get_journal_by_name/ Get journal id associated with the specified "journal_name"

  method:       GET
  url:          http://api.open-academia.org/get_journal_by_name/{journal_name}
  journal_name: varchar //the name of the journal to look for

####GET /get_journal_name/ Get journal name associated with the specified "journal_id"

  method:       GET
  url:          http://api.open-academia.org/get_journal_name/{journal_id}
  journal_id:   int //A Unique ID assigned to every journal

####GET /get_journal/ Get journal name associated with the specified "article_id"

  method:       GET
  url:          http://api.open-academia.org/get_journal/{article_id}
  article_id:   int //A Unique ID assigned to every article

####GET /get_tags_id/ Get tags id associated with the specified "article_id"

  method:       GET
  url:          http://api.open-academia.org/get_tags_id/{article_id}
  article_id:   int //A Unique ID assigned to every article

####GET /get_tag_name/ Get tag names associated with the specified "tags_id"

  method:       GET
  url:          http://api.open-academia.org/get_tag_name/{tags_id}
  tags_id:      int //A Unique ID assigned to every tag

####GET /get_tags/ Get tag names associated with the specified "article_id"

  method:       GET
  url:          http://api.open-academia.org/get_tags/{article_id}
  article_id:   int //A Unique ID assigned to every article

##Search Methods

####GET /get_articles_search_title/ Get tag names associated with the specified "article_id"

  method:       GET
  url:          http://api.open-academia.org/get_articles_search_title/{keyword}
  data:         keyword (string)

####GET /get_alternate_id_search_title/ Get tag names associated with the specified "article_id"

  method:       GET
  url:          http://api.open-academia.org/get_alternate_id_search_title/{keyword}
  data:         keyword (string)

####GET /get_articles_search_tags/ Get tag names associated with the specified "article_id"

  method:       GET
  url:          http://api.open-academia.org/get_articles_search_tags/{keyword}
  data:         keyword (string)

####GET /get_alternate_id_search_tags/ Get tag names associated with the specified "article_id"

  method:       GET
  url:          http://api.open-academia.org/get_alternate_id_search_tags/{keyword}
  data:         keyword (string)

###Example Usage

####Code in php for a GET request

<?php
$url = 'http://api.open-academia.org/api/get_article_by_id/13000/10';
$content = file_get_contents($url);
$json = json_decode($content, true);
var_dump($json);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment