Search API

To return search results in JSON format, the URL string should be in this format:

http://mydigitalpublication.com/fs_json.php?out=json&id_issue=999999&keyword=legal&c=0&searchin=3&mode=phrase&ao=1&limit=105

The available variables are as follows:

id_issue is the issue id of the issue to be searched. This can be found in the dashboard under Distribution Links -> Digital Edition -> This Issue as the number after "i=".

keyword is the search term or terms (URL encoded).

c is one of the following:

0 = standard digital edition,  

1 = circular    

searchin is one of the following:

0 = current issue,

1 = latest issue of publication of which this is an issue (ordered by issue date),

2 = all issues with an issue date of the current year

3 = all issues of this publication

4 = all issues of all publications for this publisher

mode is one of the following search modes:

any = match any term in the search string,

all = match all terms in the search string,

phrase = match the exact phrase in the search string

ao is one of the following:

0 or blank = _____________,

1 = search in the article only

limit is ______________


The URL will return a JSON document similar to this:


searches
  search
    0
      @attributes
        issueid:    "456033"
        magid:      "3610"
        page:       "1"
        type:       "2"
        url_mag:    "http://mydigitalpublication.com/publication?i=456033&p=1&search_str=neil"
        title:      "Cover"
        pic_url:    "https://cdn.coverstand.com/3610/456033/smalljpg/26d58c95eb8c9b738ff788a1a9bf83707b61860c.jpg"
        issue_name: "December 2017"
        source:     "fulltext"
        publication_name: "CHSO"
      text:         "\n\t\t\tTHE CONSUMMATE ENTERTAINER NEIL PATRICK HARRIS CREATIVE CLASS The People & Places Shaping"
      word
        @attributes
          page:     "1"
          x:        "79"
          y:        "241"
          x2:       "168"
          y2:       "293"
       text:        "\n\t\t\t\tNEIL"

    1
      @attributes
        issueid:    "456033"
        magid:      "3610"
        page:       "28"
        type:       "2"
        url_mag:    "http://mydigitalpublication.com/publication?i=456033&p=28& search_str=neil"
        title:      "Page 26"
        pic_url:    "https://cdn.coverstand.com/3610/456033/smalljpg/28358c370cf09a8bb244283dac804490de95d0f1.jpg"
        issue_name: "December 2017"
        source:     "fulltext"
        publication_name: "CHSO"
      text:         "\n\t\t\tGET the LOOK “Our cover star, Neil Patrick Harris, comes with a reputation that precedes him..."
      word
        @attributes
          page:     "28"
          x:        "140"
          y:        "170"
          x2:       "167"
          y2:       "192"
        text:       "\n\t\t\t\tNeil"

Each of the search elements is a hit and only one search element is displayed per page.

The attributes returned are as follows:

issueid is the issue id of the issue with the hit

magid is the publication id of the issue with the hit

page is the sequential number of the page

type attribute has no meaning and is just there for historical reasons

url_mag attribute is the URL that, when appended to "http://www.mydigitalpublication.com" (or the appropriate masked domain), will bring up the issue at the page on which the hit occurred.

title is the name of the page on which the hit occurred

pic_url is a URL that shows a thumbnail of the page on which the hit occurred

issue_name is the name of the issue

source is ____________

publication_name is the name of the publication

text is contextual text in which the hit occurred

There is one <word> element for every hit, even if there is more than one per page. Each <word> element displays the sequential page number (the <page> attribute), the x and y flash coordinates of the hit (X, Y, X2, and Y2). And finally between the <text> element is the search term.