2015-11-23 72 views
0

我使用的是import.io API,並且注意到某些字段類型在生成的json中返回了幾個列。例如,類型爲Money的字段foo將返回三列:foo,foo/_currencyfoo/_sourceimport.io json API:獲取列的子列表

有沒有參考的地方?我發現這裏的一些文件http://blog.import.io/post/11-columns-of-importio通過一個不完整的例子:

{ 
    "whole_number_field": 123, 
    "whole_number_field/_source": "123", 

    "language_field": "ben", 
    "language_field/_source": "bn", 

    "country_field": "CHN", 
    "country_field/_source": "China", 

    "boolean_field": false, 
    "boolean_field/_source": "false", 

    "currency_field/_currency": "GBP", 
    "currency_field/_source": "£123.45", 

    "link_field": "http://chris-alexander.co.uk", 
    "link_field/_text": "Blog", 
    "link_field/_title": "linktitle", 

    "datetime_field": 611368440000, 
    "datetime_field/_source": "17/05/89 12:34", 
    "datetime_field/_utc": "Wed May 17 00:34:00 GMT 1989", 

    "image_field": "http://io.chris-alexander.co.uk/gif2.gif", 
    "image_field/_alt": "imgalt", 
    "image_field/_title": "imgtitle", 
    "image_field/_source": "gif2.gif" 
} 

回答

1

的列在記錄API文檔: http://api.docs.import.io/

例如,對於貨幣,列有:

  • MYVAR < ==提取的值
  • MYVAR/_currency < == ISO貨幣代碼
  • MYVAR/_source < ==原值

的ISO貨幣代碼被返回作爲MYVAR/_currency,數值in myvar

0

我通過多次試驗確定這一點,我想知道如果我失去了一些東西: { 'DATE': ['_source', '_utc'], # please tell me if you have an example of an import.io API with a date! 'BOOLEAN': ['_source'], 'LANG': ['_source'], 'COUNTRY': ['_source'], 'HTML':[], 'STRING':[], 'URL': ['_text', '_source', '_title'], 'IMAGE': ['_alt', '_title', '_source'], 'DOUBLE': ['_source'], 'CURRENCY': ['_currency', '_source'], }