archetypal.dataportal.stat_can_request

archetypal.dataportal.stat_can_request(type, lang='E', dguid='2016A000011124', topic=0, notes=0, stat=0)[source]

Send a request to the StatCan API via HTTP GET and return the JSON response.

Parameters
  • type (str) – “json” or “xml”. json = json response format and xml = xml response format.

  • lang (str) – “E” or “F”. E = English and F = French.

  • dguid (str) – Dissemination Geography Unique Identifier - DGUID. It is an alphanumeric code, composed of four components. It varies from 10 to 21 characters in length. The first 9 characters are fixed in composition and length. Vintage (4) + Type (1) + Schema (4) + Geographic Unique Identifier (1-12). To find dguid, use any GEO_UID ( i.e., DGUID) returned by the 2016 Census geography web data service. For more information on the DGUID definition and structure, please refer to the Dissemination Geography Unique Identifier, Definition and Structure , Statistics Canada catalogue no. 92F0138M-2019001.

  • topic (str) – Integer 0-14 (default=0) where: 1. All topics 2. Aboriginal peoples 3. Education 4. Ethnic origin 5. Families, households and marital status 6. Housing 7. Immigration and citizenship 8. Income 9. Journey to work 10. Labour 11. Language 12. Language of work 13. Mobility 14. Population 15. Visible minority.

  • notes (int) – 0 or 1. 0 = do not include footnotes. 1 = include footnotes.

  • stat (int) – 0 or 1. 0 = counts. 1 = rates.