2015-11-23 37 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'], }