no
Viral Texts

API Documentation

Infectious texts exposes an API that can be used to query cluster, publications and supporting data. These calls can be made directly from a browser or from an external application capable of making HTTP requests, such as curl. All calls respond with JSON. All calls below must be pre-pended with the host; for example: http://infectious-texts.com/publications.json

Publications

These calls are used to gain access to the publications data.

/publications.json - Returns a list of all available publications


[
  {
    "id":1,
    "master_name":"Anderson Intelligencer", 
    "publication_frequency":"weekly",
    "state":{
       "abbreviation":"AL",
        "name":"Alabama"  
    }
  },...
]
      

/publications/filter.json?s=[state_ids]&t=[tag_ids] - Filter the list of publications by state and/or tag. The format of the response is the same as above.

/publications/{id}.json - Returns details of a specific publication


{
  "master_name": "Anderson Intelligencer",
  "publication_frequency": "weekly",
  "publication_names": [
    {
        "begin_date": "1860-01-01",
        "end_date": "1916-12-31",
        "name": "Anderson Intelligencer",
        "sn": "sn84026965"
    }
  ],
  "publication_locations": [
    {
        "date_from": "1860-01-01",
        "date_to": "1916-12-31",
        "geographic": {
            "city": "Anderson",
            "county": "Anderson",
            "lat": -82.6501,
            "lon": 34.5034,
            "state": {
                "abbreviation": "SC",
                "name": "South Carolina"
            }
        }
    }
  ],
  "publication_editors": [],
  "tags": [
    {
        "date_from": "1860-01-01",
        "date_to": "1865-12-31",
        "value": "pro-secession"
    }
  ]
}
      

Clusters

These calls are used to gain access to the cluster data.

/clusters.json - List all available clusters. The data will be returned in pages of 500 clusters at a time. To jump to other pages add a query param: ?page=#.


[
   {
    "id": 1,
    "title": "Cluster 1",
    "size": 60,
    "author": "Unknown"
   },
   {
    "id": 2,
    "title": "Cluster 2",
    "size": 58,
    "author": "Unknown"
   }, ...
]
      

/clusters/{id}.json - Get the reprint details for a cluster


[
   {
     "start_position":3817,
     "end_position":3981,
     "reprint_date":"1847-10-11",
     "url":"http://chroniclingamerica.loc.gov/lccn/sn89066057/1847-10-11/ed-1"}
     "text":"boundary the dividing line..."
   }, ...
]
      

/clusters/search.json?q=right - search the clusters data. Results are paged.

Options:

Example and JSON response format:


/clusters/search.json?q=dividing%20line&s=47&d=1850,1855&r=35,45

{
   "page":1,"total_pages":100,"hits":[
      {
         "cluster_id": 11,
         "reprint_date": "1854-06-23",
         "url": "http://chroniclingamerica.loc.gov/lccn/sn84024738/1854-06-23/ed-1",
         "snip": "...fu tare retaining the same dividing...",
         "publication": {
            "id":174,
            "name": "Daily Dispatch",
            "sn": "sn84024738"
         },
         "master_publication": {
           "id":54,
           "name":"Polynesian"
         }
      }, ... 
   ]
}

   

Other Data

These calls are used to gain access to all other supporting data, like states and tag lists.

/states.json - Get a list of states and their IDs


[
   {"id":1,"name":"Alabama","abbreviation":"AL"},
   {"id":2,"name":"Alaska","abbreviation":"AK"},...
]
      

/notes.json?type={type}&id={id} - Get a list of notes associated with a cluster or publication. Param type is required and must be either 'publication' or 'cluster'. Param id is optional. If specified, only notes associated with a specific publication or cluster will be returned.


[
   {
      "id": 1,
      "notable_id": 1,
      "notable_type": "publication",
      "note": "This is the text of a sample note on a publication",
      "user": {
        "email": "user@example.com",
        "username": "user"
      }
   },...
]
      

/tags.json - Get a list of all tag types and their associated values


[
  {
    "id":1,"name":"Political",
    "tag_type_values":[
      {"id":1,"name":"Democrat"},
      {"id":2,"name":"Free Soil"},
      {"id":3,"name":"Republican"}, ...
    ], ...
  }
]
      

/tags/{id}.json - Get a list of all values for a particular type of tag


[
  {"id":16,"name":"abolitionist"},
  {"id":17,"name":"pro-slavery"},
  {"id":18,"name":"temperance"}, ...
]
      

Sign In

Create Account

Forgot Password

Enter your email address below and we'll send you password reset instructions.

Account Settings

Loader

Please Wait...

Confirm Action

Add Tag

Type:
Value:

Upload Cluster Data

Select a new cluster data file to upload. This data will be merged with the existing cluster data.

NOTE: Infectious Texts will be read-only while the merge is in process. You will receive an email when the process is complete.